From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0437C3836C55; Wed, 16 Dec 2020 13:36:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0437C3836C55 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/93151] system_error header fails to compile with -D_XOPEN_SOURCE=600 Date: Wed, 16 Dec 2020 13:36:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 13:36:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93151 --- Comment #6 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:a2c2eec183acf25c9b214fa0827718e4d2fdfc93 commit r11-6137-ga2c2eec183acf25c9b214fa0827718e4d2fdfc93 Author: Jonathan Wakely Date: Tue Dec 15 20:28:11 2020 +0000 libstdc++: Test errno macros directly, not via autoconf [PR 93151] This fixes a bug caused by a mismatch between the macros defined by when GCC is built and the macros defined by when users include . If the user code is compiled with _XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3 (aka POSIX.1-2001). Since POSIX requires the errno macros to be macros (and not variables or enumerators) we can just test for them directly using the preprocessor. That means that will match what is actuallydefined when it's included, not what was defined when GCC was built. With that change there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and they can be removed. libstdc++-v3/ChangeLog: PR libstdc++/93151 * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove. * configure.ac: Regenerate. * config/os/generic/error_constants.h: Test POSIX errno macros directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros. * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.= cc: Likewise. * testsuite/19_diagnostics/headers/system_error/93151.cc: New test.=