Re: [Boost-bugs] [Boost C++ Libraries] #7640: Serialization of simple object throws warning with compile time flags Wconversion Wsign-compare Wcast-align

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7640: Serialization of simple object throws warning with compile time flags Wconversion Wsign-compare Wcast-align
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-06 19:38:10


#7640: Serialization of simple object throws warning with compile time flags
Wconversion Wsign-compare Wcast-align
------------------------------------------------------+---------------------
  Reporter: hardik <hardik.soni@…> | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.51.0 | Severity: Cosmetic
Resolution: invalid | Keywords:
------------------------------------------------------+---------------------
Changes (by ramey):

  * status: new => closed
  * resolution: => invalid

Comment:

 Your code example produces warnings on purpose.
 If you track back the error stack you'll eventually get back to this code:


 {{{
 template<class T>
 inline void check_object_tracking(){
     // presume it has already been determined that
     // T is not a const
     BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
     typedef BOOST_DEDUCED_TYPENAME mpl::equal_to<
         serialization::tracking_level< T >,
         mpl::int_<serialization::track_never>
>::type typex;
     // saving an non-const object of a type not marked "track_never)

     // may be an indicator of an error usage of the
     // serialization library and should be double checked.
     // See documentation on object tracking. Also, see the
     // "rationale" section of the documenation
     // for motivation for this checking.

     BOOST_STATIC_WARNING(typex::value);
 }
 }}}

 Which explains why the warning is emitted. Basically, the library writer
 (me)
 is saying "Are you really, really sure you want to do this? Think about
 the considerations raised in the comment" These warnings are raised
 to help users avoid a bad experience with the the library.

 Robert Ramey

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7640#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC