Fixed UBsan warning "call to function through pointer to incorrect function type"
[libcds.git] / cds / compiler / feature_tsan.h
index 5cf2886f6325764c6ada2b1d191adbd0b9fa0437..a6c8695c23a4bbdfcd8b6e18bdefa7caf4421fbf 100644 (file)
@@ -1,7 +1,7 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     Source code repo: http://github.com/khizmax/libcds/
     Download: http://sourceforge.net/projects/libcds/files/
@@ -50,7 +50,8 @@
 #   define CDS_TSAN_ANNOTATE_IGNORE_RW_END          \
                                                     CDS_TSAN_ANNOTATE_IGNORE_WRITES_END;\
                                                     CDS_TSAN_ANNOTATE_IGNORE_READS_END
-#   define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) AnnotateNewMemory( (char *) __FILE__, __LINE__, reinterpret_cast<void *>(addr), sz )
+#   define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) AnnotateNewMemory( __FILE__, __LINE__, reinterpret_cast<void *>(addr), sz )
+#   define CDS_TSAN_ANNOTATE_PUBLISH_MEMORY_RANGE( addr, sz ) AnnotatePublishMemoryRange( __FILE__, __LINE__, reinterpret_cast<void *>(addr), sz )
 
 #   define CDS_TSAN_ANNOTATE_MUTEX_CREATE( addr )    AnnotateRWLockCreate( __FILE__, __LINE__, reinterpret_cast<void *>(addr))
 #   define CDS_TSAN_ANNOTATE_MUTEX_DESTROY( addr )   AnnotateRWLockDestroy( __FILE__, __LINE__, reinterpret_cast<void *>(addr))
         void AnnotateIgnoreWritesBegin(const char *f, int l);
         void AnnotateIgnoreWritesEnd(const char *f, int l);
 
-        void AnnotateNewMemory(char *f, int l, void * mem, size_t size);
+        void AnnotatePublishMemoryRange( const char *f, int l, void * mem, size_t size );
+        void AnnotateNewMemory( const char *f, int l, void * mem, size_t size );
 
-        void AnnotateRWLockCreate( char *f, int l, void* m );
-        void AnnotateRWLockDestroy( char *f, int l, void* m );
+        void AnnotateRWLockCreate( const char *f, int l, void* m );
+        void AnnotateRWLockDestroy( const char *f, int l, void* m );
         void AnnotateRWLockAcquired( const char *f, int l, void *m, long is_w );
         void AnnotateRWLockReleased( const char *f, int l, void *m, long is_w );
     }
@@ -89,6 +91,7 @@
 #   define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN
 #   define CDS_TSAN_ANNOTATE_IGNORE_RW_END
 
+#   define CDS_TSAN_ANNOTATE_PUBLISH_MEMORY_RANGE( addr, sz )
 #   define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz )
 
 #   define CDS_TSAN_ANNOTATE_MUTEX_CREATE( addr )