Boost C++ Libraries: Ticket #7568: Unused parameter and shadowed member warnings in errors.hpp https://svn.boost.org/trac10/ticket/7568 <p> This code </p> <pre class="wiki">#include &lt;boost/program_options/errors.hpp&gt; int main(int, char *[]) { return 0; } </pre><p> compiled with </p> <pre class="wiki">gcc -I/path/to/boost -c -Wunused-parameter -Wshadow test.cxx </pre><p> produces a warning about an unused parameter and several warnings about shadowed class members: </p> <pre class="wiki">/opt/local/include/boost/program_options/errors.hpp:253: warning: unused parameter 'option_name' /opt/local/include/boost/program_options/errors.hpp: In constructor 'boost::program_options::invalid_syntax::invalid_syntax(boost::program_options::invalid_syntax::kind_t, const std::string&amp;, const std::string&amp;, int)': /opt/local/include/boost/program_options/errors.hpp:311: warning: declaration of 'kind' shadows a member of 'this' /opt/local/include/boost/program_options/errors.hpp: In constructor 'boost::program_options::invalid_config_file_syntax::invalid_config_file_syntax(const std::string&amp;, boost::program_options::invalid_syntax::kind_t)': /opt/local/include/boost/program_options/errors.hpp:331: warning: declaration of 'kind' shadows a member of 'this' /opt/local/include/boost/program_options/errors.hpp: In constructor 'boost::program_options::invalid_command_line_syntax::invalid_command_line_syntax(boost::program_options::invalid_syntax::kind_t, const std::string&amp;, const std::string&amp;, int)': /opt/local/include/boost/program_options/errors.hpp:350: warning: declaration of 'kind' shadows a member of 'this' </pre><p> This was compile on Mac Snow Leopard, gcc 4.2.1 with the boost distribution from macports (although I doubt any of that matters). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7568 Trac 1.4.3 Kenneth Moreland <kmorel@…> Wed, 24 Oct 2012 21:33:26 GMT <link>https://svn.boost.org/trac10/ticket/7568#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7568#comment:1</guid> <description> <p> I also discovered another shadowed parameter warning on line 232 of value_semantic.hpp. You can see all of the warnings if you compile </p> <pre class="wiki">#include &lt;boost/program_options.hpp&gt; int main(int, char *[]) { return 0; } </pre><p> with the -Wunused-parameter and -Wshadow flags. </p> </description> <category>Ticket</category> </item> </channel> </rss>