#6416 closed Bugs (fixed)
Use attribute names with underscores for GCC
Reported by: | Owned by: | Eric Niebler | |
---|---|---|---|
Milestone: | To Be Determined | Component: | accumulator |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | Cc: |
Description
... which should prevent accidental interactions between user-defined macros and boost internals.
Attachments (1)
Change History (5)
by , 11 years ago
Attachment: | boost-accumulators.patch added |
---|
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Resolving as invalid for now. If you can show that this has been supported syntax for a long time, feel free to reopen.
comment:3 by , 11 years ago
Curiously, no, I can't, it doesn't seem to be documented, but it's been supported since "forever". It's used internally by stdlibc++, and boost even uses this syntax in a couple places (move, type traits). With GCC 3.3, which is the oldest that I have around, I'm getting this:
__attribute__ ((__noinline__)) int ble() { return 10; } // passes quietly __attribute__ ((__sdkfljlk__)) int ble2() { return 10; } // gives warning
(Hopefully I typed this correctly, the machine that I tested this on is not networked.)
The code in boost is not incorrect, it just lends itself easier to user-defined macros. The underscore syntax is supported by GCC to remedy this. Please consider applying the patch.
comment:4 by , 11 years ago
Resolution: | invalid → fixed |
---|
Can you point to official gcc documentation that show that this is a supported and equivalent syntax? All I see is here: http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html, which seems to indicate that the original code is the correct form. And if the form you suggested is allowed, then is it only a recent addition?