Boost C++ Libraries: Ticket #8034: Warning fixes in multi_index https://svn.boost.org/trac10/ticket/8034 <p> We have a zero warning policy in our development projects and experience lots of warnings in several boost libraries. With every new boost version we need to apply a set of warning fixes. </p> <p> It would help a lot if you could integrate these warning fixes into future boost releases. </p> <p> Please find attached a patch file against boost 1.53.0 which fixes several warnings in boost::multi_index. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8034 Trac 1.4.3 Franz Detro <franz.detro@…> Tue, 12 Feb 2013 09:28:05 GMT attachment set https://svn.boost.org/trac10/ticket/8034 https://svn.boost.org/trac10/ticket/8034 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">multi_index.diff</span> </li> </ul> Ticket Joaquín M López Muñoz Tue, 12 Feb 2013 09:56:35 GMT <link>https://svn.boost.org/trac10/ticket/8034#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:1</guid> <description> <p> Hi Franz, </p> <p> I fail to see how the patch (which just changes some variables names <code>n</code>, <code>comp</code> to <code>np</code>, <code>comp_</code>) can silent any warning --unless you're using preprocessor symbols with the same name or something. Can you describe these warnings in more detail? </p> </description> <category>Ticket</category> </item> <item> <author>Franz Detro <franz.detro@…></author> <pubDate>Tue, 12 Feb 2013 10:02:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8034#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:2</guid> <description> <p> Hi, </p> <p> it's a warning about a class member that gets hidden by a parameter or variable name (with clang on Mac / XCode 4.5). </p> <p> Such issues might lead to hard-to-find bugs in the code, therefore this warning is enabled in our projects. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joaquín M López Muñoz</dc:creator> <pubDate>Tue, 12 Feb 2013 11:25:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8034#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:3</guid> <description> <p> OK, I see. I'll fix this. Can you please run the whole Boost.MultiIndex test suite so as to locate all similar problems with the codebase? (There must be more of these, for instance in &lt;boost/multi_index/hashed_index.hpp&gt;) </p> <p> Thank you, </p> </description> <category>Ticket</category> </item> <item> <author>Franz Detro <franz.detro@…></author> <pubDate>Tue, 12 Feb 2013 12:11:54 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8034 https://svn.boost.org/trac10/ticket/8034 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_hashed_index.txt</span> </li> </ul> Ticket Franz Detro <franz.detro@…> Tue, 12 Feb 2013 12:20:26 GMT <link>https://svn.boost.org/trac10/ticket/8034#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:4</guid> <description> <p> I've attached a compile log with the warnings. I didn't supply a fix, because these are exactly the kind of issues for which the warning is made for. For the non-maintainer (and maybe even for you) it's really hard to see which places need to be fixed and which not : </p> <p> e.g. const <a class="missing wiki">CompatibleHash</a>&amp; hash,const <a class="missing wiki">CompatiblePred</a>&amp; eq)const </p> <blockquote> <p> { </p> <blockquote> <p> std::size_t buc=buckets.position(hash(k)); </p> </blockquote> </blockquote> <p> I guess the class <a class="missing wiki">CompatibleHash</a> has an operator () which creates a hash and I need to fix it here. But if this is not the case and hash(aValue) is a member of the class hashed_index, it probably shouldn't be fixed. </p> <p> I didn't dig into the details, but maybe you understand that such code is *really* hard to read (and even harder to fix) for non-maintainers. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joaquín M López Muñoz</dc:creator> <pubDate>Tue, 12 Feb 2013 15:27:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8034#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:5</guid> <description> <p> The warnings seems to correspond to <code>test_composite_key.cpp</code> only. Can you run the whole test suite so that we're sure we collect all warnings? </p> </description> <category>Ticket</category> </item> <item> <author>Franz Detro <franz.detro@…></author> <pubDate>Wed, 13 Feb 2013 10:51:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8034#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:6</guid> <description> <p> The compilation of the other test files produced only duplicates of these warnings / warnings in other libraries (like the test framework). I'm pretty sure that we've collected all warnings in your code. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joaquín M López Muñoz</dc:creator> <pubDate>Fri, 15 Feb 2013 06:51:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8034#comment:7 https://svn.boost.org/trac10/ticket/8034#comment:7 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82897" title="fixed #8034">[82897]</a>) fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8034" title="#8034: Patches: Warning fixes in multi_index (closed: fixed)">#8034</a> </p> Ticket Joaquín M López Muñoz Fri, 15 Feb 2013 06:55:38 GMT <link>https://svn.boost.org/trac10/ticket/8034#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:8</guid> <description> <p> Franz, can you locally check that this clears your warnings? Thank you. </p> </description> <category>Ticket</category> </item> <item> <author>Franz Detro <franz.detro@…></author> <pubDate>Fri, 22 Feb 2013 07:50:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8034#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8034#comment:9</guid> <description> <p> Hi, </p> <p> I've compiled our libraries against the current boost trunk, no multi_index warnings any longer. </p> <p> Thank you very much! </p> </description> <category>Ticket</category> </item> </channel> </rss>