<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - __attribute__((no_sanitize_address)) should only be allowed at definitions"
   href="http://llvm.org/bugs/show_bug.cgi?id=19309">19309</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__attribute__((no_sanitize_address)) should only be allowed at definitions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>timurrrr@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>