Bug 205863 - serialization lib generates warnings
Summary: serialization lib generates warnings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Benjamin Kosnik
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-09 02:43 UTC by Darren Cook
Modified: 2013-08-09 05:48 UTC (History)
1 user (show)

Fixed In Version: 1.33.1-9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-20 17:29:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Darren Cook 2006-09-09 02:43:06 UTC
Description of problem:

boost::serialization library generates warnings when all warnings, include
-Wshadow, switched on in g++:

1. 
/usr/include/boost/serialization/nvp.hpp:45: warning: declaration of ‘name’
shadows a member of 'this'
/usr/include/boost/serialization/nvp.hpp: In constructor
‘boost::serialization::nvp<T>::nvp(const char*, T&) [with T = unsigned int]’:
/usr/include/boost/serialization/nvp.hpp:96:   instantiated from ‘const
boost::serialization::nvp<T> boost::serialization::make_nvp(const char*, T&)
[with T = unsigned int]’

2.
/usr/include/boost/archive/detail/iserializer.hpp:126: warning: unused parameter
‘flags’
/usr/include/boost/archive/detail/oserializer.hpp: In instantiation of ‘bool
boost::archive::detail::oserializer<Archive, T>::tracking(unsigned int) const
[with Archive = boost::archive::binary_oarchive, T = MyClass]’:

3.
/usr/include/boost/archive/detail/oserializer.hpp:118: warning: unused parameter
‘flags’
/usr/include/boost/archive/detail/oserializer.hpp: In instantiation of ‘bool
boost::archive::detail::oserializer<Archive, T>::tracking(unsigned int) const
[with Archive = boost::archive::binary_oarchive, T = std::pair<unsigned int,
unsigned int>]’:


Additional info:

With the below fixes my code compiled:

1. Add "_" after the name parameter in nvp.hpp at lines 45 and 46, e.g. so it
looks like:
    explicit nvp(const char * name_, T & t) :
        // note: redundant cast works around borland issue
        std::pair<const char *, T *>(name_, (T*)(& t))
    {}

2. Comment out "flags" in line 126 of iserializer.hpp, e.g. so it looks like:
    virtual bool tracking(const unsigned int /*flags*/) const {

3. Comment out "flags" in line 118 of oserializer.hpp, e.g. so it looks like:
    virtual bool tracking(const unsigned int /*flags*/) const {

Comment 1 Benjamin Kosnik 2006-11-13 11:08:31 UTC
Same with this one Darren: simple test case would be great.




Note You need to log in before you can comment on or make changes to this bug.