#1715 closed Bugs (fixed)
gcc-4.3 doesn't compile polymorphic_(i)(o)archive.hpp
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Boost 1.48.0 | Component: | Building Boost |
Version: | Boost Development Trunk | Severity: | Showstopper |
Keywords: | Cc: |
Description
gcc-4.3 fails to compile the serialization library. A build log is attached.
If one comments out the following parts of
- polymorphic_iarchive.hpp
- polymorphic_oarchive.hpp
#if !defined(BOOST_NO_INTRINSIC_INT64_T) virtual void save(const boost::int64_t t) = 0; virtual void save(const boost::uint64_t t) = 0; #endif
it compiles fine, thus it might involve improper detection of BOOST_NO_INTRINSIC_INT64_T.
Best,
-- Maik
Attachments (2)
Change History (9)
by , 15 years ago
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
good call - fixed in trunk
Robert Ramey
comment:3 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Your code
#if defined(BOOST_NO_INT64_T) #if defined(ULONG_MAX) #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1 #define BOOST_NO_INTRINSIC_INT64_T #endif #else #define BOOST_NO_INTRINSIC_INT64_T #endif #endif
doesn't work, since if BOOST_NO_INT64_T isn't defined ULONG_MAX isn't even considerd. I guess you want
#if defined(BOOST_NO_INT64_T) #define BOOST_NO_INTRINSIC_INT64_T #else #if defined(ULONG_MAX) #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1 #define BOOST_NO_INTRINSIC_INT64_T #endif #else #define BOOST_NO_INTRINSIC_INT64_T #endif #endif
but I prefer
#if defined(BOOST_NO_INT64_T) #define BOOST_NO_INTRINSIC_INT64_T #else #if defined(ULONG_MAX) #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1 #define BOOST_NO_INTRINSIC_INT64_T #endif #else #error "ULONG_MAX is not defined" #endif #endif
or
#if defined(BOOST_NO_INT64_T) #define BOOST_NO_INTRINSIC_INT64_T #elif defined(ULONG_MAX) #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1 #define BOOST_NO_INTRINSIC_INT64_T #endif #else #error "ULONG_MAX is not defined" #endif
comment:6 by , 14 years ago
I'm confused. Isn't the meaning of NO_INTRINSIC_INT64_T that there's no intrinsic 64 bit int, but isn't the long long an intrisic 64 bit type? Why does this get set? When I was first looking at it I though the test in polymorphic_(i/o)archive.hpp to decide whether to include the int64 templates was backwards, but now this tells me the test was right, but I didn't understand?
comment:7 by , 11 years ago
Component: | serialization → Building Boost |
---|---|
Milestone: | To Be Determined → Boost 1.48.0 |
what I was looking for, thanks
I found the origin of the problem.
This piece of code
doesn't work as expected, since ULONG_MAX is not defined at this place when g++-4.3.x is used.
The code should check if ULONG_MAX is available before using it.
The fact that ULONG_MAX is not defined is caused by the include file cleanup made for GCC-4.3. To bring ULONG_MAX back, just add
to the list of include files.
A patch which does the suggestions above, and thus fixes the build with g++-4.3.x, is attached.
Best,