Boost C++ Libraries: Ticket #9240: boost 1.54.0 math/constants/constants.hpp doesn't compile with gcc 4.8 with c++11 if you undef __STRICT_ANSI__ https://svn.boost.org/trac10/ticket/9240 <p> In gcc 4.8, they disabled some numeric literal types for c++11, including the "Q" suffix which is used for float128. Unless you use -fext-numeric-literals, you get a compile error whilst including math/constants/constants.hpp if you compile with -U__STRICT_ANSI__ </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9240 Trac 1.4.3 John Maddock Sat, 12 Oct 2013 08:43:29 GMT <link>https://svn.boost.org/trac10/ticket/9240#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9240#comment:1</guid> <description> <p> I can reproduce, but don't see any way to fix this - if you undef <code>__STRICT_ANSI__</code> then you remove all means for us to detect that GCC specific extensions are disabled. Unless you know of another way? </p> </description> <category>Ticket</category> </item> <item> <author>richardg.work@…</author> <pubDate>Wed, 20 Nov 2013 21:17:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9240#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9240#comment:2</guid> <description> <p> You could use <span class="underline">GXX_EXPERIMENTAL_CXX0X</span>, which gcc only defines when you use -std=c++11 (or -std=c++0x) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 26 Nov 2013 18:35:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9240#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9240#comment:3</guid> <description> <blockquote class="citation"> <p> You could use GXX_EXPERIMENTAL_CXX0X, which gcc only defines when you use -std=c++11 (or -std=c++0x) </p> </blockquote> <p> No that doesn't work, <code>__float128</code> along with 128-bit literals are supported or not as follows: </p> <pre class="wiki">-std=c++-03 Yes -std=gnu++-03 Yes -std=c++-11 No -std=gnu++-11 Yes </pre><p> The last two both define <code>__GXX_EXPERIMENTAL_CXX0X__</code>, the only difference between them that I can see from using g++ -E -dM is <code>__STRICT_ANSI__</code>. Indeed, GCC's own headers use <code>__STRICT_ANSI__</code> to differentiate between these two modes, so I still believe that what you're doing is basically a mistake. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Geary <richardg.work@…></author> <pubDate>Tue, 26 Nov 2013 19:46:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9240#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9240#comment:4</guid> <description> <p> There are many reasons for undefining <span class="underline">STRICT_ANSI</span> as it's widely used in system headers. If you're using boost in a large legacy codebase, and I expect it's common for people porting large codebases from C++03 to C++11. This bug is really the fault of gcc for overloading the meaning of <span class="underline">STRICT_ANSI</span> to imply their special features are enabled/disabled. GCC doesn't own the <span class="underline">STRICT_ANSI</span> #define, it's owned by the ISO standard. </p> <p> Regardless, since the issue is with the numeric literal not the <span class="underline">float128 type, is there a different, more compatible way to specify the literals? </span></p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 23 Dec 2013 10:06:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9240#comment:5 https://svn.boost.org/trac10/ticket/9240#comment:5 <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> Fixed in Git develop: I've added and documented two config macros: BOOST_MATH_USE_FLOAT128 and BOOST_MATH_DISABLE_FLOAT128 which explicitly enable/disable this feature. Defining the latter macro should fix things for your use case. </p> Ticket