https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85672

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #4)
> (In reply to Jonathan Wakely from comment #3)
> > Yes it woud have been broken by r259813 and this should fix it:
> 
> I don't think that's sufficient:
> - the same code is present in several files

Only two.

include/bits/std_abs.h and include/std/type_traits


> - -Wsystem-headers -Wundef will warn

That's the status quo. It would take a ton of effort to avoid -Wundef warnings
in libstdc++ and that's not something I'm going to work on.


> - it still leaves a weird situation where _GLIBCXX_USE_FLOAT128 may be 1, 0
> or undefined, instead of just 2 choices.

Ah yes, good point. So we could either change include/Makefile.am to #undef it
instead of setting it to 0, or do:

--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -611,7 +611,10 @@ namespace std

 /* Define if __float128 is supported on this host. */
 #define _GLIBCXX_USE_FLOAT128
-#if !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)
+#if _GLIBCXX_USE_FLOAT128 == 0
+#undef _GLIBCXX_USE_FLOAT128
+#endif
+#elif !defined(__FLOAT128__) && !defined(__SIZEOF_FLOAT128__)
 #undef _GLIBCXX_USE_FLOAT128
 #endif


I think I'd prefer to change include/Makefile.am

Then no changes to <bits/std_abs.h> and <type_traits> would be needed.

Reply via email to