Modify

Ticket #6416 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 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:

Description

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

Attachments

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

Change History

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

comment:1 Changed 2 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 2 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 2 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 2 years ago by eric_niebler

  • Resolution changed from invalid to fixed

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

View

Add a comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.