Ticket #6416 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

Use attribute names with underscores for GCC

Reported by: Petr Machata <pmachata@…> Owned by: eric_niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:


... which should prevent accidental interactions between user-defined macros and boost internals.


boost-accumulators.patch (1.2 KB) - added by Petr Machata <pmachata@…> 5 years ago.

Change History

Changed 5 years ago by Petr Machata <pmachata@…>

comment:1 Changed 5 years ago by eric_niebler

Can you point to official gcc documentation that show that this is a supported and equivalent syntax? All I see is here:, 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?

comment:2 Changed 5 years ago by eric_niebler

  • Status changed from new to closed
  • Resolution set to invalid

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 Changed 5 years ago by Petr Machata <pmachata@…>

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 Changed 5 years ago by eric_niebler

  • Resolution changed from invalid to fixed

(In [76637]) Use attribute names with underscores for GCC, fixes #6416


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.