#3657 closed Bugs (fixed)
integer.hpp does not compile in MSVS 8.0 with /Za
Reported by: | Owned by: | Daryle Walker | |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | integer |
Version: | Boost 1.42.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Change History (3)
comment:1 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Milestone: | Boost 1.42.0 → Boost 1.43.0 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Version: | Boost 1.41.0 → 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.
boost/config/compiler/visualc.hpp#128-132
#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1500)) # define BOOST_HAS_LONG_LONG #else # define BOOST_NO_LONG_LONG #endif
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.
boost/integer_fwd.hpp#80-86
#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 >; #endif
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
boost/config/suffix.hpp#467-477
#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 } #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 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
(In [57843]) Fix preprocessor logic for long long support. Fixes #3657. Fixes #3568.