Opened 16 years ago

Closed 16 years ago

#670 closed Bugs (None)

[archive] Fix unused parameter warning

Reported by: schlotter Owned by: Robert Ramey
Milestone: Component: serialization
Version: None Severity:
Keywords: Cc:

Description

Hi!

The function parameter to `bool tracking(const unsigned
int flags) const' in `archive/detail/oserializer.hpp'
is currently unused.  The attached trivial patch
against HEAD[1] fixes this.

Regards
Christian

[1]
http://boost.cvs.sourceforge.net/*checkout*/boost/boost/boost/archive/detail/oserializer.hpp

Change History (4)

comment:1 by schlotter, 16 years ago

Logged In: YES 
user_id=1440711

Robert, coincidental I saw your reply on the mailing list
archives.

Robert Ramey wrote:
> Hmm - looks like its used to me.
> 
> C:\BoostHead\libs\serialization\src\basic_oarchive.cpp(259):
> ar.vsave(tracking_type(bos.tracking(m_flags)));
>
C:\BoostHead\libs\serialization\src\basic_oarchive.cpp(266):
if(!
> bos.tracking(m_flags)){
> C:\BoostHead\libs\serialization\src\basic_oarchive.cpp(342):
> ar.vsave(tracking_type(bos.tracking(m_flags)));
>
C:\BoostHead\libs\serialization\src\basic_oarchive.cpp(352):
if(!
> bos.tracking(m_flags)){
>
C:\BoostHead\libs\serialization\src\basic_xml_grammar.ipp(355):
>> uint_p
> [assign_level(rv.tracking_level)]

For convenience, the function definition we're talking about:
    virtual bool tracking(const unsigned int flags) const {
//        if(0 != (flags &  no_tracking))
//            return false;
        return
boost::serialization::tracking_level<T>::value ==
boost::serialization::track_always
            ||
boost::serialization::tracking_level<T>::value ==
boost::serialization::track_selectivly
            && serialized_as_pointer();
    }

As you can see, the part which uses the parameter is
commented out.  So, the parameter may be used, but it is
ignored in the function body.

Regards
Christian

comment:2 by schlotter, 16 years ago

Logged In: YES 
user_id=1440711

I just noticed that I missed a similar warning.  The second
attached patch fixes this too.

comment:3 by schlotter, 16 years ago

Logged In: YES 
user_id=1440711

Robert Ramey wrote:
OK - I've applied the patches to my local copy which will be
uploaded to
CVS/Head.  Sorry this won't show up in boost until version
1.35.  So if this
is important to you, you should patch your own copy.

Robert Ramey

comment:4 by schlotter, 16 years ago

Status: assignedclosed
Note: See TracTickets for help on using tickets.