]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add system_header pragma to <bits/c++config.h>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 17 May 2023 12:47:54 +0000 (13:47 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 17 May 2023 19:01:49 +0000 (20:01 +0100)
Without this change many tests that depend on an effective-target will
fail when compiled with -pedantic -std=c++98. This happens because the
preprocessor check done by v3_check_preprocessor_condition uses -Werror
and includes <bits/c++config.h> directly (rather than via another header
like <string>). If <bits/c++config.h> is not a system header then this
pedwarn is not suppressed, and the effective-target check fails:

bits/c++config.h:220: error: anonymous variadic macros were introduced in C++11 [-Werror=variadic-macros]
cc1plus: all warnings being treated as errors
compiler exited with status 1
UNSUPPORTED: 18_support/headers/limits/synopsis.cc

We could consider also changing proc v3_check_preprocessor_condition so
that it includes a real header, rather than just <bits/c++config.h>, but
that's not necessary for now.

libstdc++-v3/ChangeLog:

* include/bits/c++config: Add system_header pragma.

libstdc++-v3/include/bits/c++config

index 13892787e095c9810a616399658d0d98de6338e9..009a017b048f2e5e8fa46a713c9f7f5404d1e4a2 100644 (file)
@@ -30,6 +30,8 @@
 #ifndef _GLIBCXX_CXX_CONFIG_H
 #define _GLIBCXX_CXX_CONFIG_H 1
 
+#pragma GCC system_header
+
 // The major release number for the GCC release the C++ library belongs to.
 #define _GLIBCXX_RELEASE