Boost C++ Libraries: Ticket #3657: integer.hpp does not compile in MSVS 8.0 with /Za https://svn.boost.org/trac10/ticket/3657 <p> Compilation of a CPP file containing only an inclusion to &lt;boost/integer.hpp&gt; fails on MS Visual Studio 2008 Standard when /Za option is used (extensions are disabled). </p> <p> It seems the error should show up on other editions of VS 2008 and on VS 2005 as well. </p> <p> It seems the error is caused by "config/compiler/visualc.hpp" incorrectly not defining ::boost::long_long_type in case of /Za option. </p> <p> It seems the error is also caused by "integer_fwd.hpp" checking for ULLONG_MAX preprocessor definition rather then BOOST_HAS_LONG_LONG. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3657 Trac 1.4.3 John Maddock Sun, 22 Nov 2009 16:38:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3657#comment:1 https://svn.boost.org/trac10/ticket/3657#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57843" title="Fix preprocessor logic for long long support. Fixes #3657. Fixes #3568.">[57843]</a>) Fix preprocessor logic for long long support. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3657" title="#3657: Bugs: integer.hpp does not compile in MSVS 8.0 with /Za (closed: fixed)">#3657</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3568" title="#3568: Bugs: integer.hpp fails to compile with /Za switch (closed: fixed)">#3568</a>. </p> Ticket abadura@… Thu, 04 Feb 2010 08:56:48 GMT status, version, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/3657#comment:2 https://svn.boost.org/trac10/ticket/3657#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.41.0</span> → <span class="trac-field-new">Boost 1.42.0</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.42.0</span> → <span class="trac-field-new">Boost 1.43.0</span> </li> </ul> <p> The problem still exists for VS 2005. </p> <p> It seems there is more then one problem here actually. </p> <hr /> <p> Visual C++ configuration is incorrect. </p> <p> <strong>boost/config/compiler/visualc.hpp#128-132</strong> </p> <pre class="wiki">#if (_MSC_VER &gt;= 1310) &amp;&amp; (defined(_MSC_EXTENSIONS) || (_MSC_VER &gt;= 1500)) # define BOOST_HAS_LONG_LONG #else # define BOOST_NO_LONG_LONG #endif </pre><p> Visual C++ 2005 (which is <strong>_MSC_VER == 1400</strong>) also has <strong>long long</strong> type (regardless whether <strong>_MSC_EXTENSIONS</strong> is defined or not). </p> <hr /> <p> Integer headers are still incorrect. </p> <p> <strong>boost/integer_fwd.hpp#80-86</strong> </p> <pre class="wiki">#if !defined(BOOST_NO_INTEGRAL_INT64_T) &amp;&amp; !defined(BOOST_NO_INT64_T) &amp;&amp; (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) template &lt; &gt; class integer_traits&lt; ::boost::long_long_type&gt;; template &lt; &gt; class integer_traits&lt; ::boost::ulong_long_type &gt;; #endif </pre><p> It seems that <strong>BOOST_HAS_MS_INT64</strong> in no way influences existence of <strong>::boost::long_long_type</strong> thus it should disappear from the condition because it leads to broken compilation. </p> <p> Or the other way: it should start influence existence of <strong>::boost::long_long_type</strong>. To achieve this preprocessor condition in </p> <p> <strong>boost/config/suffix.hpp#467-477</strong> </p> <pre class="wiki">#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 </pre><p> should include <strong>BOOST_HAS_MS_INT64</strong>. </p> <p> 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. </p> <hr /> <p> In Visual Studio 2008 it seems to be fine now. </p> Ticket John Maddock Thu, 04 Feb 2010 11:15:56 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3657#comment:3 https://svn.boost.org/trac10/ticket/3657#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59468" title="Change integer code to still work when BOOST_HAS_MS_INT64 is defined ...">[59468]</a>) 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 <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3657" title="#3657: Bugs: integer.hpp does not compile in MSVS 8.0 with /Za (closed: fixed)">#3657</a>. </p> Ticket