Boost C++ Libraries: Ticket #2414: Fix for "defined but not used" warning https://svn.boost.org/trac10/ticket/2414 <p> The following simple patch seems to make GCC a whole lot happier: </p> <div class="wiki-code"> <div class="diff"> <ul class="entries"> <li class="entry"> <h2> <a>properties.hpp</a> </h2> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File properties.hpp (revision 3157)"> </th> <th title="File properties.hpp (working copy)"> </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>93</th><th>93</th><td class="l"><span>#else</span></td> </tr> <tr> <th>94</th><th>94</th><td class="l"><span>#define BOOST_DEF_PROPERTY(KIND, NAME) \</span></td> </tr> <tr> <th>95</th><th>95</th><td class="l"><span>&nbsp; struct KIND##_##NAME##_t {};&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</span></td> </tr> </tbody> <tbody class="mod"> <tr class="first"> <th>96</th><th>&nbsp;</th><td class="l"><span>&nbsp; namespace { KIND##_##NAME##_t <del>KIND##_##NAME; }&nbsp; &nbsp; &nbsp;</del>&nbsp; &nbsp;\</span></td> </tr> <tr class="last"> <th>&nbsp;</th><th>96</th><td class="r"><span>&nbsp; namespace { KIND##_##NAME##_t <ins>const KIND##_##NAME = {}; }</ins>&nbsp; &nbsp;\</span></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>97</th><th>97</th><td class="l"><span>&nbsp; BOOST_INSTALL_PROPERTY(KIND, NAME)</span></td> </tr> <tr> <th>98</th><th>98</th><td class="l"><span>#endif</span></td> </tr> <tr> <th>99</th><th>99</th><td class="l"><span></span></td> </tr> </tbody> </table> </li> </ul> </div></div><p> I haven't tested it against the trunk tests but if you are willing to try and see what breaks, I would be happy to apply it in trunk if you give me the go-ahead. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2414 Trac 1.4.3 Douglas Gregor Wed, 15 Oct 2008 21:05:43 GMT <link>https://svn.boost.org/trac10/ticket/2414#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2414#comment:1</guid> <description> <p> Please go ahead and apply to the trunk </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Wed, 15 Oct 2008 23:47:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2414#comment:2 https://svn.boost.org/trac10/ticket/2414#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> Turns out the trunk avoids this problem by using enums. </p> Ticket leyisong@… Mon, 28 Jun 2010 15:45:26 GMT <link>https://svn.boost.org/trac10/ticket/2414#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2414#comment:3</guid> <description> <p> I also meet a prooblem just like "defined but not used" warning..... It drives me mad~ </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 28 Jun 2010 16:33:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2414#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2414#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2414#comment:3" title="Comment 3">leyisong@…</a>: </p> <blockquote class="citation"> <p> I also meet a prooblem just like "defined but not used" warning..... It drives me mad~ </p> </blockquote> <p> This comment is somewhat pointless unless you can be more specific. </p> </description> <category>Ticket</category> </item> </channel> </rss>