Fix serialization warnings

Issue #168 resolved
Frank Dellaert created an issue

Jing, low priority but you're my warning guy now :-)

Scanning dependencies of target testLinearContainerFactor
[ 73%] Building CXX object gtsam/nonlinear/tests/CMakeFiles/testLinearContainerFactor.dir/testLinearContainerFactor.cpp.o
In file included from /Users/frank/git/gtsam/gtsam/linear/tests/testSerializationLinear.cpp:28:
In file included from /Users/frank/git/gtsam/gtsam/base/serializationTestHelpers.h:25:
In file included from /Users/frank/git/gtsam/gtsam/base/serialization.h:27:
In file included from /opt/local/include/boost/serialization/export.hpp:38:
In file included from /opt/local/include/boost/serialization/static_warning.hpp:73:
/opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
    const int m_x = 1 / (sizeof(T) - sizeof(T));
                  ^
/opt/local/include/boost/mpl/print.hpp:50:23: warning: division by zero is undefined [-Wdivision-by-zero]
    const int m_x = 1 / (sizeof(T) - sizeof(T));
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/serialization/static_warning.hpp:93:13: note: in instantiation of template class
      'boost::mpl::print<boost::serialization::BOOST_SERIALIZATION_STATIC_WARNING_LINE<137> >' requested here
    >::type type;
            ^
/opt/local/include/boost/serialization/export.hpp:137:9: note: in instantiation of template class 'boost::serialization::static_warning_test<false,
      137>' requested here
        BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value);
        ^
/opt/local/include/boost/serialization/static_warning.hpp:106:33: note: expanded from macro 'BOOST_STATIC_WARNING'
#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__)
                                ^
/opt/local/include/boost/serialization/static_warning.hpp:104:9: note: expanded from macro 'BOOST_SERIALIZATION_BSW'
        sizeof( boost::serialization::static_warning_test< B, L > ) \
        ^
/Users/frank/git/gtsam/gtsam/linear/tests/testSerializationLinear.cpp:47:1: note: in instantiation of member function
      'boost::archive::detail::extra_detail::guid_initializer<boost::shared_ptr<gtsam::noiseModel::Base> >::export_guid' requested here
BOOST_CLASS_EXPORT_GUID(gtsam::SharedNoiseModel, "gtsam_SharedNoiseModel");
^
/opt/local/include/boost/serialization/export.hpp:189:72: note: expanded from macro 'BOOST_CLASS_EXPORT_GUID'
BOOST_CLASS_EXPORT_KEY2(T, K)                                          \
                                                                       ^
/opt/local/include/boost/serialization/export.hpp:167:35: note: expanded from macro '\
BOOST_CLASS_EXPORT_IMPLEMENT'
        >::get_mutable_instance().export_guid();             \
                                  ^
Linking CXX executable testVectorValues
[ 73%] Built target testVectorValues
Scanning dependencies of target testSerializationNonlinear
[ 73%] Building CXX object gtsam/nonlinear/tests/CMakeFiles/testSerializationNonlinear.dir/testSerializationNonlinear.cpp.o
In file included from /Users/frank/git/gtsam/gtsam/nonlinear/tests/testSerializationNonlinear.cpp:26:
In file included from /Users/frank/git/gtsam/gtsam/base/serializationTestHelpers.h:25:
In file included from /Users/frank/git/gtsam/gtsam/base/serialization.h:27:
In file included from /opt/local/include/boost/serialization/export.hpp:38:
In file included from /opt/local/include/boost/serialization/static_warning.hpp:73:
/opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
    const int m_x = 1 / (sizeof(T) - sizeof(T));
                  ^
/opt/local/include/boost/mpl/print.hpp:50:23: warning: division by zero is undefined [-Wdivision-by-zero]
    const int m_x = 1 / (sizeof(T) - sizeof(T));
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/boost/serialization/static_warning.hpp:93:13: note: in instantiation of template class
      'boost::mpl::print<boost::serialization::BOOST_SERIALIZATION_STATIC_WARNING_LINE<137> >' requested here
    >::type type;
            ^
/opt/local/include/boost/serialization/export.hpp:137:9: note: in instantiation of template class 'boost::serialization::static_warning_test<false,
      137>' requested here
        BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value);
        ^
/opt/local/include/boost/serialization/static_warning.hpp:106:33: note: expanded from macro 'BOOST_STATIC_WARNING'
#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__)
                                ^
/opt/local/include/boost/serialization/static_warning.hpp:104:9: note: expanded from macro 'BOOST_SERIALIZATION_BSW'
        sizeof( boost::serialization::static_warning_test< B, L > ) \
        ^
/Users/frank/git/gtsam/gtsam/nonlinear/tests/testSerializationNonlinear.cpp:35:1: note: in instantiation of member function
      'boost::archive::detail::extra_detail::guid_initializer<gtsam::Cal3_S2>::export_guid' requested here
BOOST_CLASS_EXPORT(gtsam::Cal3_S2);
^
/opt/local/include/boost/serialization/export.hpp:227:5: note: expanded from macro 'BOOST_CLASS_EXPORT'
    BOOST_CLASS_EXPORT_GUID(                    \
    ^
/opt/local/include/boost/serialization/export.hpp:189:72: note: expanded from macro 'BOOST_CLASS_EXPORT_GUID'
BOOST_CLASS_EXPORT_KEY2(T, K)                                          \
                                                                       ^
/opt/local/include/boost/serialization/export.hpp:167:35: note: expanded from macro '\
BOOST_CLASS_EXPORT_IMPLEMENT'
        >::get_mutable_instance().export_guid();             \
                                  ^

Comments (3)

  1. Frank Dellaert reporter

    And more:

    In file included from /Users/frank/git/gtsam/gtsam/base/tests/testSerializationBase.cpp:26:
    In file included from /Users/frank/git/gtsam/gtsam/base/serializationTestHelpers.h:25:
    In file included from /Users/frank/git/gtsam/gtsam/base/serialization.h:27:
    In file included from /opt/local/include/boost/serialization/export.hpp:38:
    In file included from /opt/local/include/boost/serialization/static_warning.hpp:73:
    /opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
        const int m_x = 1 / (sizeof(T) - sizeof(T));
    

    and

    In file included from /Users/frank/git/gtsam/gtsam/symbolic/tests/testSerializationSymbolic.cpp:21:
    In file included from /Users/frank/git/gtsam/gtsam/base/serializationTestHelpers.h:25:
    In file included from /Users/frank/git/gtsam/gtsam/base/serialization.h:27:
    In file included from /opt/local/include/boost/serialization/export.hpp:38:
    In file included from /opt/local/include/boost/serialization/static_warning.hpp:73:
    /opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
        const int m_x = 1 / (sizeof(T) - sizeof(T));
    

    and

    In file included from /Users/frank/git/gtsam/gtsam/geometry/tests/testSerializationGeometry.cpp:32:
    In file included from /Users/frank/git/gtsam/gtsam/base/serializationTestHelpers.h:25:
    In file included from /Users/frank/git/gtsam/gtsam/base/serialization.h:27:
    In file included from /opt/local/include/boost/serialization/export.hpp:38:
    In file included from /opt/local/include/boost/serialization/static_warning.hpp:73:
    /opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
        const int m_x = 1 / (sizeof(T) - sizeof(T));
                      ^
    

    These warnings could point to an actual problem with serialization.

  2. Log in to comment