Boost logo

Boost :

Subject: Re: [boost] [1.41.0] [integer] integer.hpp does not compile in MSVC 8.0with /Za option on
From: Adam Badura (abadura_at_[hidden])
Date: 2009-11-22 08:13:12


    I tracked the error myself a bit and it seems in comes from what appears
to be a bug in "config/compiler/visualc.hpp". There at lines 128-132 we
have:

---------------
#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS)
# define BOOST_HAS_LONG_LONG
#else
# define BOOST_NO_LONG_LONG
#endif
---------------

    _MSC_EXTENSIONS is defined only if /Za option is used (extensions are
enabled). Otherwise it is not defined.
    But MS VS recognizes "long long" and "unsigned long long" regardless of
whether extensions are enabled or disabled. So this part of the preprocessor
condition is not needed.

    Even more. I think this exposes other problems in Boost libraries. The
error first shows up in "integer_fwd.hpp" header at lines 68-74, where there
is:

---------------
#ifdef ULLONG_MAX
template < >
    class integer_traits< ::boost::long_long_type>;

template < >
    class integer_traits< ::boost::ulong_long_type >;
#endif
---------------

    Why this checks for ULLONG_MAX rather then BOOST_HAS_LONG_LONG /
BOOST_NO_LONG_LONG? If it did check for the second one then there would be
no error (however Boost would still inccorectly assume that "long long" and
"unsigned long long" are not available). So either the code there should use
BOOST_HAS_LONG_LONG / BOOST_NO_LONG_LONG or it should check for consistency
of those two and ULLONG_MAX.

    Adam Badura


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk