# HG changeset patch # User František Kučera # Date 1532785353 -7200 # Node ID 98b901d7bb9514a457305878a0e13d057a26de98 # Parent 90efe2db1ca8d455bc5f74cfc88b7e82d649587a ASan: add AddressSanitizer g++ option: -fsanitize=address diff -r 90efe2db1ca8 -r 98b901d7bb95 nbproject/Makefile-Debug.mk --- a/nbproject/Makefile-Debug.mk Wed Jul 25 01:33:57 2018 +0200 +++ b/nbproject/Makefile-Debug.mk Sat Jul 28 15:42:33 2018 +0200 @@ -42,8 +42,8 @@ CFLAGS= # CC Compiler Flags -CCFLAGS= -CXXFLAGS= +CCFLAGS=-fsanitize=address +CXXFLAGS=-fsanitize=address # Fortran Compiler Flags FFLAGS= diff -r 90efe2db1ca8 -r 98b901d7bb95 nbproject/configurations.xml --- a/nbproject/configurations.xml Wed Jul 25 01:33:57 2018 +0200 +++ b/nbproject/configurations.xml Sat Jul 28 15:42:33 2018 +0200 @@ -47,6 +47,9 @@ false + + -fsanitize=address + diff -r 90efe2db1ca8 -r 98b901d7bb95 src/DataTypeWriterBase.h --- a/src/DataTypeWriterBase.h Wed Jul 25 01:33:57 2018 +0200 +++ b/src/DataTypeWriterBase.h Sat Jul 28 15:42:33 2018 +0200 @@ -37,6 +37,8 @@ * @param type used as a safety mechanism to avoid wrong pointer interpretation; * should be called in this way: writeRaw(output, &value, typeid(value)); * if the type does not match, the RelpipeWriterException is thrown + * + * TODO: typeid() / type_info seems working but consider also sizeof() / size_t and teplates */ virtual void writeRaw(std::ostream& output, const void * value, const std::type_info& type) = 0;