Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#3657 closed Bugs (fixed)

integer.hpp does not compile in MSVS 8.0 with /Za

Reported by: abadura@… Owned by: dlwalker
Milestone: Boost 1.43.0 Component: integer
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:


Compilation of a CPP file containing only an inclusion to <boost/integer.hpp> fails on MS Visual Studio 2008 Standard when /Za option is used (extensions are disabled).

It seems the error should show up on other editions of VS 2008 and on VS 2005 as well.

It seems the error is caused by "config/compiler/visualc.hpp" incorrectly not defining ::boost::long_long_type in case of /Za option.

It seems the error is also caused by "integer_fwd.hpp" checking for ULLONG_MAX preprocessor definition rather then BOOST_HAS_LONG_LONG.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by johnmaddock

  • Resolution set to fixed
  • Status changed from new to closed

(In [57843]) Fix preprocessor logic for long long support. Fixes #3657. Fixes #3568.

comment:2 Changed 7 years ago by abadura@…

  • Milestone changed from Boost 1.42.0 to Boost 1.43.0
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from Boost 1.41.0 to Boost 1.42.0

The problem still exists for VS 2005.

It seems there is more then one problem here actually.

Visual C++ configuration is incorrect.


#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1500))

Visual C++ 2005 (which is _MSC_VER == 1400) also has long long type (regardless whether _MSC_EXTENSIONS is defined or not).

Integer headers are still incorrect.


#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64))
template <  >
    class integer_traits<  ::boost::long_long_type>;

template <  >
    class integer_traits<  ::boost::ulong_long_type >;

It seems that BOOST_HAS_MS_INT64 in no way influences existence of ::boost::long_long_type thus it should disappear from the condition because it leads to broken compilation.

Or the other way: it should start influence existence of ::boost::long_long_type. To achieve this preprocessor condition in


#if defined(BOOST_HAS_LONG_LONG)
namespace boost{
#  ifdef __GNUC__
   __extension__ typedef long long long_long_type;
   __extension__ typedef unsigned long long ulong_long_type;
#  else
   typedef long long long_long_type;
   typedef unsigned long long ulong_long_type;
#  endif

should include BOOST_HAS_MS_INT64.

Which of those two is correct depends on how all Visual C++ compilers behave. I have only access to 2005 and 2008 so someone else should check it on 2003 and earlier.

In Visual Studio 2008 it seems to be fine now.

comment:3 Changed 7 years ago by johnmaddock

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [59468]) Change integer code to still work when BOOST_HAS_MS_INT64 is defined but BOOST_HAS_LONG_LONG is not. Update VC++ config to define BOOST_HAS_LONG_LONG for MSVC-8 in ANSI mode. Fixes #3657.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain dlwalker.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.