Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6416 closed Bugs (fixed)

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:

Description

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

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

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

Attachment: boost-accumulators.patch added

comment:1 Changed 6 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: 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?

comment:2 Changed 6 years ago by Eric Niebler

Resolution: invalid
Status: newclosed

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 6 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 6 years ago by Eric Niebler

Resolution: invalidfixed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Eric Niebler.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.