[LLVMbugs] [Bug 19309] New: __attribute__((no_sanitize_address)) should only be allowed at definitions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 2 07:38:55 PDT 2014


            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: unassignedclangbugs at nondot.org
          Reporter: timurrrr at google.com
                CC: llvmbugs at cs.uiuc.edu
    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
- 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140402/1e609684/attachment.html>

More information about the llvm-bugs mailing list