Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error with Boost 1.58.0 #1475

Closed
eschnett opened this issue Apr 23, 2015 · 2 comments
Closed

Build error with Boost 1.58.0 #1475

eschnett opened this issue Apr 23, 2015 · 2 comments
Milestone

Comments

@eschnett
Copy link
Contributor

HPX does not build with Boost 1.58.0 on OS X. It fails with the error message

/Users/eschnett/software/boost-1.58.0/include/boost/serialization/vector.hpp:216:18: error: comparison of integers of different signs: 'int' and 'base_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
    for(i = 0; i < count; ++i){
               ~ ^ ~~~~~

which is caused by this Boost routine:

template<class Archive, class Allocator>
inline void load(
    Archive & ar,
    std::vector<bool, Allocator> &t,
    const unsigned int /* file_version */
){
    // retrieve number of elements
    collection_size_type count;
    ar >> BOOST_SERIALIZATION_NVP(count);
    t.resize(count);
    int i;
    for(i = 0; i < count; ++i){
        bool b;
        ar >> boost::serialization::make_nvp("item", b);
        t[i] = b;
    }
}

which compares int i with unsigned long count in the for loop. One wonders why the author uses int to iterate over a container in this day and age, in particular since the container's size type is readily available. I recommend switching to Cereal for serialization.

Can you disable -Werror for release builds of HPX? I agree this is very useful during development, but for a release this has too many false positives.

@sithhell
Copy link
Member

HPX does not build with Boost 1.58.0 on OS X. It fails with the error message

/Users/eschnett/software/boost-1.58.0/include/boost/serialization/vector.hpp:216:18:
error: comparison of integers of different signs: 'int' and 'base_type'
(aka 'unsigned long') [-Werror,-Wsign-compare]
for(i = 0; i < count; ++i){
~ ^ ~~~~~

which is caused by this Boost routine:

template<class Archive, class Allocator>
inline void load(
Archive & ar,
std::vector<bool, Allocator> &t,
const unsigned int /* file_version */
){
// retrieve number of elements
collection_size_type count;
ar >> BOOST_SERIALIZATION_NVP(count);
t.resize(count);
int i;
for(i = 0; i < count; ++i){
bool b;
ar >> boost::serialization::make_nvp("item", b);
t[i] = b;
}
}

which compares int i with unsigned long count in the for loop. One
wonders why the author uses int to iterate over a container in this day and
age, in particular since the container's size type is readily available. I
recommend switching to Cereal for serialization.

Thanks for the report. This should be fixed on master as we removed
boost.serialization entirely.

Can you disable -Werror for release builds of HPX? I agree this is very
useful during development, but for a release this has too many false
positives.

Sounds like a good strategy. Eventually we want to make hpx itself
completely warning free for the next release. Disabling -Werror for
releases is a good idea in any case.

@hkaiser
Copy link
Member

hkaiser commented Apr 23, 2015

Our released versions were released before Boost 1.58 came out, so naturally we can't really support it. It will be supported with the next released version of HPX, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants