Bug 205863 - serialization lib generates warnings
serialization lib generates warnings
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: boost (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Benjamin Kosnik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-08 22:43 EDT by Darren Cook
Modified: 2013-08-09 01:48 EDT (History)
1 user (show)

See Also:
Fixed In Version: 1.33.1-9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-20 12:29:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Darren Cook 2006-09-08 22:43:06 EDT
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 06:08:31 EST
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.