Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#1715 closed Bugs (fixed)

gcc-4.3 doesn't compile polymorphic_(i)(o)archive.hpp

Reported by: Maik Beckmann <Beckmann.Maik@…> 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)

build_log (5.3 KB ) - added by Maik Beckmann <Beckmann.Maik@…> 15 years ago.
serialization_gcc43.patch (1.8 KB ) - added by Maik Beckmann <Beckmann.Maik@…> 15 years ago.
fix build with GCC-4.3

Download all attachments as: .zip

Change History (9)

by Maik Beckmann <Beckmann.Maik@…>, 15 years ago

Attachment: build_log added

comment:1 by Maik Beckmann <Beckmann.Maik@…>, 15 years ago

I found the origin of the problem.

This piece of code

#if defined(BOOST_NO_INT64_T) \
    || (ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u) // 2**64 - 1
#   define BOOST_NO_INTRINSIC_INT64_T
#endif

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

#include <climits>

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,

-- Maik

by Maik Beckmann <Beckmann.Maik@…>, 15 years ago

Attachment: serialization_gcc43.patch added

fix build with GCC-4.3

comment:2 by Robert Ramey, 15 years ago

Resolution: fixed
Status: newclosed

good call - fixed in trunk

Robert Ramey

comment:3 by Maik Beckmann <Beckmann.Maik@…>, 15 years ago

Resolution: fixed
Status: closedreopened

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:4 by Robert Ramey, 15 years ago

Resolution: fixed
Status: reopenedclosed

OK - fixed again

comment:5 by Maik Beckmann <Beckmann.Maik@…>, 15 years ago

Works!

Thank you for quickly responding,

-- Maik

comment:6 by patrick@…, 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 Essexiaerania, 11 years ago

Component: serializationBuilding Boost
Milestone: To Be DeterminedBoost 1.48.0

what I was looking for, thanks

Note: See TracTickets for help on using tickets.