Boost C++ Libraries: Ticket #498: Compiler warning with gcc on Linux https://svn.boost.org/trac10/ticket/498 <pre class="wiki">I get the following warning compiling on Linux with gcc. No mater what I do I can't seem to get around the warning. Any ideas? Thanks! g++ -c -pipe -Wall -W -g -fPIC -I/usr/lib/qt-3.1/mkspecs/default -I. -I. -Iinclude -Isrc -I../ccbus -I/usr/lib/qt-3.1/include -I.ui/ -I.moc/ -o .obj/TraderButtonKey.o src/TraderButtonKey.cpp /usr/include/boost/archive/detail/common_iarchive.hpp: In member function `void boost::archive::detail::common_iarchive&lt;Archive&gt;::init() [with Archive = boost::archive::text_iarchive]': /usr/include/boost/archive/text_iarchive.hpp:69: instantiated from `boost::archive::text_iarchive_impl&lt;Archive&gt;::text_iarchive_impl(std::istream&amp;, unsigned int) [with Archive = boost::archive::text_iarchive]' /usr/include/boost/archive/text_iarchive.hpp:82: instantiated from here /usr/include/boost/archive/detail/common_iarchive.hpp:75: warning: choosing ` boost::archive::version_type::operator unsigned int&amp;()' over ` boost::archive::version_type::operator unsigned int() const' /usr/include/boost/archive/detail/common_iarchive.hpp:75: warning: for conversion from `boost::archive::version_type' to `unsigned int' /usr/include/boost/archive/detail/common_iarchive.hpp:75: warning: because conversion sequence for the argument is better Code fragment: class TraderButtonKey { public: //! Default constructor. TraderButtonKey( ) : m_cls(0), m_number(0) {} //! Constructor. //! //! \param cls the class //! \param number the number TraderButtonKey( int cls, int number ) : m_cls(cls), m_number(number) {} ... private: //! Required by the boost C++ libraries to provide serialization to //! and from the archive. //! //! \param ar archive to save/load object members //! \param version boost class version template&lt;class Archive&gt; void serialize( Archive &amp; ar, const unsigned int version ) { if (version) // gets rid of unused parameter warning ; ar &amp; m_cls; ar &amp; m_number; } int m_cls; //!&lt; class of the key int m_number; //!&lt; number within that class }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/498 Trac 1.4.3 nobody Tue, 25 Oct 2005 12:54:52 GMT <link>https://svn.boost.org/trac10/ticket/498#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/498#comment:1</guid> <description> <pre class="wiki">Logged In: NO Ooops ... forgot my email ... rbys@hotmail.com ... thanks! </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>nobody</dc:creator> <pubDate>Tue, 25 Oct 2005 13:00:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/498#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/498#comment:2</guid> <description> <pre class="wiki">Logged In: NO Ooops ... forgot my email ... rbys@hotmail.com ... thanks! </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>straszheim</dc:creator> <pubDate>Tue, 25 Oct 2005 13:20:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/498#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/498#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=167007 I've seen these too, FWIW, with (I believe) gcc 3.2.3. What boost version/compiler are you using? This patch: 75c75 &lt; basic_iarchive::init(input_library_version.operator unsigned int()); --- &gt; basic_iarchive::init(input_library_version); to boost/archive/detail/common_iarchive.hpp stops the warning for version 1.32.0. IIRC. Haven't doublechecked with Robert if this is completely kosher or not, though... -troy d. straszheim </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>nobody</dc:creator> <pubDate>Tue, 25 Oct 2005 13:27:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/498#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/498#comment:4</guid> <description> <pre class="wiki">Logged In: NO Ooops ... forgot my email ... rbys@hotmail.com ... thanks! </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>nobody</dc:creator> <pubDate>Tue, 25 Oct 2005 16:39:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/498#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/498#comment:5</guid> <description> <pre class="wiki">Logged In: NO Ooops ... forgot my email ... rbys@hotmail.com ... thanks! </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Thu, 01 Dec 2005 23:46:47 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/498#comment:6 https://svn.boost.org/trac10/ticket/498#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=396141 Bogus warning. See manual. In any event, code was tweaked to avoid generation of the message on this compiler Robert Ramey </pre> Ticket