[Bug libstdc++/93151] system_error header fails to compile with -D_XOPEN_SOURCE=600

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 9 14:13:00 GMT 2020


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The config/os/generic/error_constants.h file already uses these macros
conditionally:

#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
      state_not_recoverable =                   ENOTRECOVERABLE,
#endif

The problem is that we use those config macros, which are fixed when libstdc++
is built and don't match the set of available macros when preprocessing the
header.

We should either do:

#if defined _GLIBCXX_HAVE_ENOTRECOVERABLE && defined ENOTRECOVERABLE
      state_not_recoverable =                   ENOTRECOVERABLE,
#endif

or simply:

#ifdef ENOTRECOVERABLE
      state_not_recoverable =                   ENOTRECOVERABLE,
#endif

I don't know what the advantage of testing for them at configure time is.


More information about the Gcc-bugs mailing list