[PATCH] Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the usages of this macro

Alexey Samsonov samsonov at google.com
Mon Aug 12 09:39:42 PDT 2013



================
Comment at: asan/asan_interface_internal.h:110
@@ -108,3 +109,3 @@
   /* OPTIONAL */ void __asan_on_error()
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+      SANITIZER_WEAK_ATTRIBUTE;
 
----------------
Why not move SANITIZER_WEAK_ATTRIBUTE before the function declaration as well for consistency?

================
Comment at: sanitizer_common/sanitizer_internal_defs.h:99
@@ -96,3 +98,3 @@
   void __sanitizer_sandbox_on_notify(void *reserved)
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+      SANITIZER_WEAK_ATTRIBUTE;
 
----------------
ditto

================
Comment at: tsan/rtl/tsan_interceptors.cc:372
@@ -373,1 +371,3 @@
+SANITIZER_INTERFACE_ATTRIBUTE
+extern "C" int __interceptor_setjmp(void *env);
 extern "C" int __interceptor_setjmp(void *env) {
----------------
Alright. Can we:
1) use common extern "C" {} for all these interceptors?
2) have only a definition, w/o additional declaration? Specifying attributes before the
function definition should be fine.

================
Comment at: tsan/rtl/tsan_interceptors.cc:506
@@ -507,1 +505,3 @@
+SANITIZER_INTERFACE_ATTRIBUTE
+void *operator new(__sanitizer::uptr size);
 void *operator new(__sanitizer::uptr size) {
----------------
ditto


http://llvm-reviews.chandlerc.com/D1364



More information about the llvm-commits mailing list