http://llvm.org/bugs/show_bug.cgi?id=19309

            Bug ID: 19309
           Summary: __attribute__((no_sanitize_address)) should only be
                    allowed at definitions
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

I believe __attribute__((no_sanitize_address)) should only be allowed at
function/method definitions.

Consider a code like this:
--- x.h ---
class X {
  void f();
  __attribute__((no_sanitize_address)) void g();
};
-----------

-- x.cpp --
#include "x.h"

__attribute__((no_sanitize_address)) void X::f() {
  ...
}

void X::g() {
  ...
}
-----------

I've spent half a day analyzing a file like x.cpp before I looked at x.h.

I think we should disallow __attribute__((no_sanitize_address)) at declaraions
because:
- it's more consistent
- it's much more readable, there's no "implicit attribute applied somewhere
else" when looking at the code of a function/method.
- applying/removing the attribute would usually result in fewer recompilations

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to