[Bug c++/60924] __attribute__((no_sanitize_address)) and friends should (only?) be allowed at function definitions

timurrrr at google dot com gcc-bugzilla@gcc.gnu.org
Wed Apr 23 09:21:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60924

--- Comment #5 from Timur Iskhodzhanov <timurrrr at google dot com> ---
Jakub wrote:
> all other attributes are allowed on both declarations and definitions

Can you please point me at the documentation that says that attributes are
allowed on definitions?  The page I referenced above only mentions
declarations.

Also, I believe "all the existing/old attributes do X, so all the new ones
should do X as well" isn't an optimal long-term strategy.
It's just not flexible / generic enough.

Andrew wrote:
> More consistent with what

By "more consistent" I meant there will be fewer ways to use the attribute and
this would reduce the number of places one has to look at to find out whether a
given attribute is applied.

> Is there is only one coding style in this world?

This is indeed subjective.
Still, I think my point #3 (re: implementation detail) should be true in most
reasonable coding styles?

> Modules for the win.

True -- but they aren't used yet in most codebases AFAICT :)



More information about the Gcc-bugs mailing list