Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2005-10-25 07:52:28


Bugs item #1337412, was opened at 2005-10-25 05:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1337412&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: serialization
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Robert Ramey (ramey)
Summary: Compiler warning with gcc on Linux

Initial Comment:
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<Archive>::init()
[with Archive =
   boost::archive::text_iarchive]':
/usr/include/boost/archive/text_iarchive.hpp:69:
instantiated from
`boost::archive::text_iarchive_impl<Archive>::text_iarchive_impl(std::istream&,
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&()' 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<class Archive> void serialize( Archive &
ar, const unsigned int version )
    {

        if (version) // gets rid of unused parameter
warning
            ;

        ar & m_cls;
        ar & m_number;
    }

    int m_cls; //!< class of
the key
    int m_number; //!< number
within that class
};

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1337412&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk