Boost C++ Libraries: Ticket #6416: Use attribute names with underscores for GCC https://svn.boost.org/trac10/ticket/6416 <p> ... which should prevent accidental interactions between user-defined macros and boost internals. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6416 Trac 1.4.3 Petr Machata <pmachata@…> Mon, 16 Jan 2012 23:08:25 GMT attachment set https://svn.boost.org/trac10/ticket/6416 https://svn.boost.org/trac10/ticket/6416 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-accumulators.patch</span> </li> </ul> Ticket Eric Niebler Mon, 16 Jan 2012 23:18:10 GMT <link>https://svn.boost.org/trac10/ticket/6416#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6416#comment:1</guid> <description> <p> Can you point to official gcc documentation that show that this is a supported and equivalent syntax? All I see is here: <a class="ext-link" href="http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html"><span class="icon">​</span>http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html</a>, 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? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Eric Niebler</dc:creator> <pubDate>Tue, 17 Jan 2012 16:06:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6416#comment:2 https://svn.boost.org/trac10/ticket/6416#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Resolving as invalid for now. If you can show that this has been supported syntax for a long time, feel free to reopen. </p> Ticket Petr Machata <pmachata@…> Fri, 20 Jan 2012 16:23:40 GMT <link>https://svn.boost.org/trac10/ticket/6416#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6416#comment:3</guid> <description> <p> 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: </p> <pre class="wiki"> __attribute__ ((__noinline__)) int ble() { return 10; } // passes quietly __attribute__ ((__sdkfljlk__)) int ble2() { return 10; } // gives warning </pre><p> (Hopefully I typed this correctly, the machine that I tested this on is not networked.) </p> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Eric Niebler</dc:creator> <pubDate>Sun, 22 Jan 2012 17:56:12 GMT</pubDate> <title>resolution changed https://svn.boost.org/trac10/ticket/6416#comment:4 https://svn.boost.org/trac10/ticket/6416#comment:4 <ul> <li><strong>resolution</strong> <span class="trac-field-old">invalid</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76637" title="Use attribute names with underscores for GCC, fixes #6416">[76637]</a>) Use attribute names with underscores for GCC, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6416" title="#6416: Bugs: Use attribute names with underscores for GCC (closed: fixed)">#6416</a> </p> Ticket