From patchwork Thu Sep 12 20:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1984860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Prn5Buu9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X4V3t6TKgz1y1C for ; Fri, 13 Sep 2024 06:51:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D01F2385C6C6 for ; Thu, 12 Sep 2024 20:51:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 9D3D53858D28 for ; Thu, 12 Sep 2024 20:51:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D3D53858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9D3D53858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726174280; cv=none; b=rdjRY9GOo6E+3OnpRHU1oBrPxVoyEASRPpxjOBMm47MqyR7vsJqrSoR1qeSoiNIvphiiJnQ9Jnm4l1THeqlEuy/ghiUmcwItRXubaBRWbcjbxU6lUXreQcBdkGQYHdN7svsCbsA3m/1cPfnKlU6uShH1RvJpjf2Xt86wvJW2ajE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726174280; c=relaxed/simple; bh=rvCkPgmYd4kvGh8peep/4JKt4xQnojMPA3WNfqpOhPY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=L82KwZM56kVl97mZZCl33LWGbqRA7RYDQnmrIB1bjLqQ+DdKtnRzBV3GAB9GLcR2J/93Qf4KeiNkvZckRROtSHVKFlenbDvu0M/FiExGCOWsJq4+LojZpcdp6OJKDZG12RDadRNnD8Vybguc65b3+4auza/TuaQba8V7FLCpi7k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726174274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tQFTlK11dWYdB+BHNOb8tt7pjvpR0M3LE/x5d5I76gs=; b=Prn5Buu9GmdJ+rABJKCeKvsP7rRPpLWWLZdiikiQNAKDXwQelmr6LZCkA8u2H5vMI7Zk2l ktCelIZId/r7gwHtdGbqWy/tCHjH5d7K2bwtfAjxdkw5SJNOlYL6I7ETOA8sQuDOwqu8cf n23I5dgdn1XLv7hnLeiFpDhDoMq6Rkc= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-fcUKWn4PPUO0pm0f4psNSw-1; Thu, 12 Sep 2024 16:51:12 -0400 X-MC-Unique: fcUKWn4PPUO0pm0f4psNSw-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7a9a95429c4so30385285a.1 for ; Thu, 12 Sep 2024 13:51:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726174271; x=1726779071; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tQFTlK11dWYdB+BHNOb8tt7pjvpR0M3LE/x5d5I76gs=; b=gj96laM5Ly+upBh0MOh/Y6GZAh2UE9YoRJ0hnCfzeUoDKQf7P3G8quW+aCLRMMMlJ4 WSaOurpiNK+PlVBMfNWbMlds7CLqUxgiOkJUP7Bhiv60c5+5DQeO0sUEJvSrWlW2asLx 1xRKo/DJvjxkrUBx0xZBKHeS3uM2Ct1rnYwXFuwCPOJCUWTRwqdc30u6iYV911ffR2IH yw+ueww8ymPWz1d4V10N6tfwQ5tHDYSZyvFQBUzUXm62xR0VkGuy86UJdFQWbQpvKhTs SIme3VKok9caanVN7yEkP5aemd7B2jgZN9akmFPymnqLcf2c4hfY/yb52Olef5672l7e OtRg== X-Gm-Message-State: AOJu0YxYDWeIafr5gr9J04cL5xAQ7thm2t0bRi/yeYti+JR0dxIh0jBe z7w8xKgR+IBNsKEDPa7FjyNNoNBMZR33DKrClsGwR2tvCjg09n+Mt/AbME3/P/aWQxDSBlBXsPH QQnkvDgRR+tUZ3WZR+4H4+WQEoRnlOhWRPQ7E0uZw2KkP6sNEaJ+7LLoRRjrBA9cFp1lblv98dZ LSCg5Y7TVdbTsT0Dgy0o0mY6geL2aWFerHrS8= X-Received: by 2002:a05:620a:4049:b0:79f:433:6e7f with SMTP id af79cd13be357-7ab30d247b3mr71463885a.21.1726174270409; Thu, 12 Sep 2024 13:51:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPokbiOcY+JDwfdJ5X6OQJHnh+tuKxGKEt6s+cUK1+tI5Nnn7E3SwcU/5gDsnh044rgbLH+A== X-Received: by 2002:a05:620a:4049:b0:79f:433:6e7f with SMTP id af79cd13be357-7ab30d247b3mr71458085a.21.1726174269386; Thu, 12 Sep 2024 13:51:09 -0700 (PDT) Received: from jason-thinkpadp1gen4i.rmtusma.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a9a7945761sm585069985a.10.2024.09.12.13.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 13:51:09 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org Subject: [PATCH RFC] libstdc++: add #pragma diagnostic Date: Thu, 12 Sep 2024 16:49:40 -0400 Message-ID: <20240912205107.4021799-1-jason@redhat.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-pc-linux-gnu. Thoughts about the remaining warnings discussed below? Any other comments? -- 8< -- The use of #pragma GCC system_header in libstdc++ has led to bugs going undetected for a while due to the silencing of compiler warnings that would have revealed them promptly, and also interferes with warnings about problematic template instantiations induced by user code. But removing it, or even compiling with -Wsystem-header, is also problematic due to warnings about deliberate uses of extensions. So this patch adds #pragma GCC diagnostic as needed to suppress these warnings. The change to acinclude.m4 changes -Wabi to warn only in comparison to ABI 19, to avoid lots of warnings that we now mangle concept requirements, which are in any case still experimental. It also enables -Wsystem-headers while building the library, so we see any warnings not silenced by these #pragmas. After this patch, the remaining warnings I see are: ios_base_init.h:12: warning about reserved init_priority I'll add a warning flag to silence this. exception_ptr.h:155: warning about useless attribute((const)) on void fn. Should we remove the attribute? cxx11-ios_failure.cc:98: warning about overriding the two-parameter __do_upcast that isn't overridden in __si_class_type_info, rather than the three-parameter form that is overridden in __si_class_type_info. I suppose this must be working, and changing the signature would be an ABI break, so maybe we just want to silence the warning? It's also unclear that -Woverloaded-virtuals=1 is supposed to warn when the function is in fact an override; it warns in this case because it's overriding a function that its direct base didn't also override. I have a follow-up patch to #ifdef out all the #pragma system_header, but want that to be considered separately. libstdc++-v3/ChangeLog: * include/bits/algorithmfwd.h: * include/bits/allocator.h: * include/bits/codecvt.h: * include/bits/concept_check.h: * include/bits/cpp_type_traits.h: * include/bits/hashtable.h: * include/bits/iterator_concepts.h: * include/bits/ostream_insert.h: * include/bits/ranges_base.h: * include/bits/regex_automaton.h: * include/bits/std_abs.h: * include/bits/stl_algo.h: * include/c_compatibility/fenv.h: * include/c_compatibility/inttypes.h: * include/c_compatibility/stdint.h: * include/ext/concurrence.h: * include/ext/type_traits.h: * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: * include/bits/basic_ios.tcc: * include/bits/basic_string.tcc: * include/bits/fstream.tcc: * include/bits/istream.tcc: * include/bits/locale_classes.tcc: * include/bits/locale_facets.tcc: * include/bits/ostream.tcc: * include/bits/regex_compiler.tcc: * include/bits/sstream.tcc: * include/bits/streambuf.tcc: * configure: Regenerate. * include/bits/c++config: * include/c/cassert: * include/c/cctype: * include/c/cerrno: * include/c/cfloat: * include/c/climits: * include/c/clocale: * include/c/cmath: * include/c/csetjmp: * include/c/csignal: * include/c/cstdarg: * include/c/cstddef: * include/c/cstdio: * include/c/cstdlib: * include/c/cstring: * include/c/ctime: * include/c/cwchar: * include/c/cwctype: * include/c_global/climits: * include/c_global/cmath: * include/c_global/cstddef: * include/c_global/cstdlib: * include/decimal/decimal: * include/ext/rope: * include/std/any: * include/std/charconv: * include/std/complex: * include/std/coroutine: * include/std/format: * include/std/iomanip: * include/std/limits: * include/std/numbers: * include/tr1/functional: * include/tr1/tuple: * include/tr1/type_traits: * libsupc++/compare: * libsupc++/new: Add #pragma GCC diagnostic to suppress undesired warnings. * acinclude.m4: Change -Wabi version from 2 to 19. --- libstdc++-v3/include/bits/algorithmfwd.h | 5 +++++ libstdc++-v3/include/bits/allocator.h | 4 ++++ libstdc++-v3/include/bits/codecvt.h | 4 ++++ libstdc++-v3/include/bits/concept_check.h | 4 ++++ libstdc++-v3/include/bits/cpp_type_traits.h | 5 +++++ libstdc++-v3/include/bits/hashtable.h | 5 +++++ libstdc++-v3/include/bits/iterator_concepts.h | 4 ++++ libstdc++-v3/include/bits/ostream_insert.h | 4 ++++ libstdc++-v3/include/bits/ranges_base.h | 4 ++++ libstdc++-v3/include/bits/regex_automaton.h | 5 +++++ libstdc++-v3/include/bits/std_abs.h | 5 +++++ libstdc++-v3/include/bits/stl_algo.h | 5 +++++ libstdc++-v3/include/c_compatibility/fenv.h | 5 +++++ libstdc++-v3/include/c_compatibility/inttypes.h | 5 +++++ libstdc++-v3/include/c_compatibility/stdint.h | 5 +++++ libstdc++-v3/include/ext/concurrence.h | 5 +++++ libstdc++-v3/include/ext/type_traits.h | 5 +++++ .../ext/type_traits/add_unsigned_floating_neg.cc | 2 +- .../ext/type_traits/add_unsigned_integer_neg.cc | 2 +- .../ext/type_traits/remove_unsigned_floating_neg.cc | 2 +- .../ext/type_traits/remove_unsigned_integer_neg.cc | 2 +- libstdc++-v3/acinclude.m4 | 2 +- libstdc++-v3/include/bits/basic_ios.tcc | 4 ++++ libstdc++-v3/include/bits/basic_string.tcc | 4 ++++ libstdc++-v3/include/bits/fstream.tcc | 4 ++++ libstdc++-v3/include/bits/istream.tcc | 4 ++++ libstdc++-v3/include/bits/locale_classes.tcc | 5 +++++ libstdc++-v3/include/bits/locale_facets.tcc | 4 ++++ libstdc++-v3/include/bits/ostream.tcc | 4 ++++ libstdc++-v3/include/bits/regex_compiler.tcc | 7 ++++++- libstdc++-v3/include/bits/sstream.tcc | 4 ++++ libstdc++-v3/include/bits/streambuf.tcc | 4 ++++ libstdc++-v3/configure | 2 +- libstdc++-v3/include/bits/c++config | 7 +++++++ libstdc++-v3/include/c/cassert | 5 +++++ libstdc++-v3/include/c/cctype | 5 +++++ libstdc++-v3/include/c/cerrno | 5 +++++ libstdc++-v3/include/c/cfloat | 5 +++++ libstdc++-v3/include/c/climits | 5 +++++ libstdc++-v3/include/c/clocale | 5 +++++ libstdc++-v3/include/c/cmath | 5 +++++ libstdc++-v3/include/c/csetjmp | 5 +++++ libstdc++-v3/include/c/csignal | 5 +++++ libstdc++-v3/include/c/cstdarg | 5 +++++ libstdc++-v3/include/c/cstddef | 5 +++++ libstdc++-v3/include/c/cstdio | 5 +++++ libstdc++-v3/include/c/cstdlib | 5 +++++ libstdc++-v3/include/c/cstring | 5 +++++ libstdc++-v3/include/c/ctime | 5 +++++ libstdc++-v3/include/c/cwchar | 5 +++++ libstdc++-v3/include/c/cwctype | 5 +++++ libstdc++-v3/include/c_global/climits | 5 +++++ libstdc++-v3/include/c_global/cmath | 5 +++++ libstdc++-v3/include/c_global/cstddef | 5 +++++ libstdc++-v3/include/c_global/cstdlib | 4 ++++ libstdc++-v3/include/decimal/decimal | 4 ++++ libstdc++-v3/include/ext/rope | 6 ++++++ libstdc++-v3/include/std/any | 5 +++++ libstdc++-v3/include/std/charconv | 4 ++++ libstdc++-v3/include/std/complex | 4 ++++ libstdc++-v3/include/std/coroutine | 4 ++++ libstdc++-v3/include/std/format | 9 +++++++++ libstdc++-v3/include/std/iomanip | 4 ++++ libstdc++-v3/include/std/limits | 6 ++++++ libstdc++-v3/include/std/numbers | 5 +++++ libstdc++-v3/include/tr1/functional | 5 +++++ libstdc++-v3/include/tr1/tuple | 4 ++++ libstdc++-v3/include/tr1/type_traits | 4 ++++ libstdc++-v3/libsupc++/compare | 6 ++++++ libstdc++-v3/libsupc++/new | 4 ++++ 70 files changed, 313 insertions(+), 7 deletions(-) base-commit: c5009eb887910271ea35a857aa68941c7227b9c7 diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index 34bf9921f43..7f1f15970ab 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -39,6 +39,9 @@ #include #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -962,6 +965,8 @@ _GLIBCXX_END_NAMESPACE_ALGO _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #ifdef _GLIBCXX_PARALLEL # include #endif diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index 9e75b37fce7..ebb487a3ffe 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -49,6 +49,9 @@ #include #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -292,4 +295,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h index 41a1d30b11d..c51cc7d220d 100644 --- a/libstdc++-v3/include/bits/codecvt.h +++ b/libstdc++-v3/include/bits/codecvt.h @@ -41,6 +41,9 @@ #include #include // locale::facet +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -840,4 +843,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif // _CODECVT_H diff --git a/libstdc++-v3/include/bits/concept_check.h b/libstdc++-v3/include/bits/concept_check.h index 65f662b70bf..6479f2fa919 100644 --- a/libstdc++-v3/include/bits/concept_check.h +++ b/libstdc++-v3/include/bits/concept_check.h @@ -34,6 +34,9 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wvariadic-macros" + // All places in libstdc++-v3 where these are used, or /might/ be used, or // don't need to be used, or perhaps /should/ be used, are commented with // "concept requirements" (and maybe some more text). So grep like crazy @@ -78,4 +81,5 @@ #endif // enable/disable +#pragma GCC diagnostic pop #endif // _GLIBCXX_CONCEPT_CHECK diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h index ff74c557245..e3a80e06346 100644 --- a/libstdc++-v3/include/bits/cpp_type_traits.h +++ b/libstdc++-v3/include/bits/cpp_type_traits.h @@ -40,6 +40,9 @@ # include // is_same_v, is_integral_v #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + // // This file provides some compile-time information about various types. // These representations were designed, on purpose, to be constant-expressions @@ -582,4 +585,6 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace } // extern "C++" +#pragma GCC diagnostic pop + #endif //_CPP_TYPE_TRAITS_H diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 361da2b3b4d..b02bddf5635 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -40,6 +40,9 @@ # include #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -2758,4 +2761,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #endif // _HASHTABLE_H diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index 642c709fee0..4ac6e6bfbe7 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -37,6 +37,9 @@ #include // to_address #include // identity, ranges::less +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -1044,5 +1047,6 @@ namespace ranges #endif // C++20 library concepts _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif // C++20 #endif // _ITERATOR_CONCEPTS_H diff --git a/libstdc++-v3/include/bits/ostream_insert.h b/libstdc++-v3/include/bits/ostream_insert.h index e6857615790..d61b4b14f97 100644 --- a/libstdc++-v3/include/bits/ostream_insert.h +++ b/libstdc++-v3/include/bits/ostream_insert.h @@ -36,6 +36,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -131,4 +134,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif /* _OSTREAM_INSERT_H */ diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h index 63eb552b48b..0c6a4e83bb2 100644 --- a/libstdc++-v3/include/bits/ranges_base.h +++ b/libstdc++-v3/include/bits/ranges_base.h @@ -39,6 +39,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 + #ifdef __cpp_lib_concepts namespace std _GLIBCXX_VISIBILITY(default) { @@ -1073,5 +1076,6 @@ namespace ranges _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // library concepts +#pragma GCC diagnostic pop #endif // C++20 #endif // _GLIBCXX_RANGES_BASE_H diff --git a/libstdc++-v3/include/bits/regex_automaton.h b/libstdc++-v3/include/bits/regex_automaton.h index 574ec90dc3a..03179a0e687 100644 --- a/libstdc++-v3/include/bits/regex_automaton.h +++ b/libstdc++-v3/include/bits/regex_automaton.h @@ -33,6 +33,9 @@ #define _GLIBCXX_REGEX_STATE_LIMIT 100000 #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // anon struct + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -397,4 +400,6 @@ namespace __detail _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #include diff --git a/libstdc++-v3/include/bits/std_abs.h b/libstdc++-v3/include/bits/std_abs.h index 48d44160bab..1e9ed83a0b2 100644 --- a/libstdc++-v3/include/bits/std_abs.h +++ b/libstdc++-v3/include/bits/std_abs.h @@ -43,6 +43,9 @@ #undef abs +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + extern "C++" { namespace std _GLIBCXX_VISIBILITY(default) @@ -151,4 +154,6 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace } // extern "C++" +#pragma GCC diagnostic pop + #endif // _GLIBCXX_BITS_STD_ABS_H diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 778a37ac46f..a1ef665506d 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -72,6 +72,9 @@ # endif #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // inline namespace + // See concept_check.h for the __glibcxx_*_requires macros. namespace std _GLIBCXX_VISIBILITY(default) @@ -5901,4 +5904,6 @@ _GLIBCXX_END_NAMESPACE_ALGO _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #endif /* _STL_ALGO_H */ diff --git a/libstdc++-v3/include/c_compatibility/fenv.h b/libstdc++-v3/include/c_compatibility/fenv.h index 6800814bca5..a587e7308af 100644 --- a/libstdc++-v3/include/c_compatibility/fenv.h +++ b/libstdc++-v3/include/c_compatibility/fenv.h @@ -31,11 +31,16 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #if _GLIBCXX_HAVE_FENV_H # include_next #endif +#pragma GCC diagnostic pop + #if __cplusplus >= 201103L #if _GLIBCXX_USE_C99_FENV diff --git a/libstdc++-v3/include/c_compatibility/inttypes.h b/libstdc++-v3/include/c_compatibility/inttypes.h index bc63119097c..5a428ce0bd7 100644 --- a/libstdc++-v3/include/c_compatibility/inttypes.h +++ b/libstdc++-v3/include/c_compatibility/inttypes.h @@ -31,6 +31,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #if __cplusplus >= 201103L @@ -88,4 +91,6 @@ namespace std #endif // C++11 +#pragma GCC diagnostic pop + #endif // _GLIBCXX_INTTYPES_H diff --git a/libstdc++-v3/include/c_compatibility/stdint.h b/libstdc++-v3/include/c_compatibility/stdint.h index 0b6a8c16627..2d892e7ceb2 100644 --- a/libstdc++-v3/include/c_compatibility/stdint.h +++ b/libstdc++-v3/include/c_compatibility/stdint.h @@ -31,6 +31,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #if __cplusplus >= 201103L @@ -107,4 +110,6 @@ namespace std #endif // C++11 +#pragma GCC diagnostic pop + #endif // _GLIBCXX_STDINT_H diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h index 7629c1b1129..8188c1366b0 100644 --- a/libstdc++-v3/include/ext/concurrence.h +++ b/libstdc++-v3/include/ext/concurrence.h @@ -37,6 +37,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -312,4 +315,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/ext/type_traits.h b/libstdc++-v3/include/ext/type_traits.h index 75d7edf85b8..165e1b43da0 100644 --- a/libstdc++-v3/include/ext/type_traits.h +++ b/libstdc++-v3/include/ext/type_traits.h @@ -34,6 +34,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + extern "C++" { namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) @@ -270,4 +273,6 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace } // extern "C++" +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc index 261fe84b0ae..458748af28a 100644 --- a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc +++ b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc @@ -35,4 +35,4 @@ int main() } // { dg-error "required from" "" { target *-*-* } 28 } -// { dg-error "no type" "" { target *-*-* } 71 } +// { dg-error "no type" "" { target *-*-* } 74 } diff --git a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc index f592478dd97..c1dde44e118 100644 --- a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc +++ b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc @@ -36,5 +36,5 @@ int main() } // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } -// { dg-error "declaration of" "" { target *-*-* } 100 } // { dg-error "declaration of" "" { target *-*-* } 103 } +// { dg-error "declaration of" "" { target *-*-* } 106 } diff --git a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc index 42078e556f6..5f77c1a652a 100644 --- a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc +++ b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc @@ -35,4 +35,4 @@ int main() } // { dg-error "required from" "" { target *-*-* } 28 } -// { dg-error "no type" "" { target *-*-* } 114 } +// { dg-error "no type" "" { target *-*-* } 117 } diff --git a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc index f017aecdb8a..7f5a304c526 100644 --- a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc +++ b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc @@ -36,5 +36,5 @@ int main() } // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } -// { dg-error "declaration of" "" { target *-*-* } 143 } // { dg-error "declaration of" "" { target *-*-* } 146 } +// { dg-error "declaration of" "" { target *-*-* } 149 } diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index e4ed583b3ae..768c2991ec2 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -707,7 +707,7 @@ AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [ # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc AC_SUBST(OPTIMIZE_CXXFLAGS) - WARN_FLAGS="-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2" + WARN_FLAGS="-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=19 -Wsystem-headers" AC_SUBST(WARN_FLAGS) ]) diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index 0197bdf8f67..1519603f6b5 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -32,6 +32,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -181,4 +184,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index e458c1880b2..8a764855698 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -41,6 +41,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + #include namespace std _GLIBCXX_VISIBILITY(default) @@ -1031,4 +1034,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index a5accecd846..7b246ad59d2 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -36,6 +36,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + #include #include // for swap #include @@ -1094,4 +1097,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index 16423bfbfcb..23a7c849777 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -36,6 +36,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + #include namespace std _GLIBCXX_VISIBILITY(default) @@ -1166,4 +1169,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/locale_classes.tcc b/libstdc++-v3/include/bits/locale_classes.tcc index d5ef1911057..4dedfd76af6 100644 --- a/libstdc++-v3/include/bits/locale_classes.tcc +++ b/libstdc++-v3/include/bits/locale_classes.tcc @@ -36,6 +36,10 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template +#pragma GCC diagnostic ignored "-Wvariadic-macros" + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -380,4 +384,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index cde81bffc08..4e9bf6fb8f9 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -32,6 +32,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -1433,4 +1436,5 @@ _GLIBCXX_END_NAMESPACE_LDBL _GLIBCXX_END_NAMESPACE_VERSION } // namespace +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 972de79ea70..7aeb23ad38d 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -36,6 +36,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + #include namespace std _GLIBCXX_VISIBILITY(default) @@ -390,4 +393,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc index 3c6cb6649df..9c5a46a47cd 100644 --- a/libstdc++-v3/include/bits/regex_compiler.tcc +++ b/libstdc++-v3/include/bits/regex_compiler.tcc @@ -55,6 +55,9 @@ // All dummy nodes will be eliminated at the end of compilation. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++20-extensions" // variadic macro with 0 args + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -621,4 +624,6 @@ namespace __detail } // namespace __detail _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std + +#pragma GCC diagnostic pop diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc index 9acf15f399f..7eb5561b630 100644 --- a/libstdc++-v3/include/bits/sstream.tcc +++ b/libstdc++-v3/include/bits/sstream.tcc @@ -36,6 +36,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -304,4 +307,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc index 3cfee68defc..0c28033f491 100644 --- a/libstdc++-v3/include/bits/streambuf.tcc +++ b/libstdc++-v3/include/bits/streambuf.tcc @@ -36,6 +36,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -166,4 +169,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop #endif diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 005c4a29fd0..de05e63de4c 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -55720,7 +55720,7 @@ $as_echo "$gxx_include_dir" >&6; } # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc - WARN_FLAGS="-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2" + WARN_FLAGS="-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=19 -Wsystem-headers" diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 54d455be226..66d03cfd037 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -32,6 +32,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wvariadic-macros" +#pragma GCC diagnostic ignored "-Wc++11-extensions" +#pragma GCC diagnostic ignored "-Wc++23-extensions" // bf16 + // The major release number for the GCC release the C++ library belongs to. #define _GLIBCXX_RELEASE @@ -910,4 +915,6 @@ namespace __gnu_cxx #endif // __has_include #endif // C++17 +#pragma GCC diagnostic pop + // End of prewritten config; the settings discovered at configure time follow. diff --git a/libstdc++-v3/include/c/cassert b/libstdc++-v3/include/c/cassert index 5cd11fff9ec..ef6e844a72b 100644 --- a/libstdc++-v3/include/c/cassert +++ b/libstdc++-v3/include/c/cassert @@ -30,5 +30,10 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #include_next + +#pragma GCC diagnostic pop diff --git a/libstdc++-v3/include/c/cctype b/libstdc++-v3/include/c/cctype index c6f65039435..a7a59551d86 100644 --- a/libstdc++-v3/include/c/cctype +++ b/libstdc++-v3/include/c/cctype @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cerrno b/libstdc++-v3/include/c/cerrno index 9e47b182d25..29bf0b403aa 100644 --- a/libstdc++-v3/include/c/cerrno +++ b/libstdc++-v3/include/c/cerrno @@ -40,9 +40,14 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #include_next +#pragma GCC diagnostic pop + // Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 #ifndef errno #define errno errno diff --git a/libstdc++-v3/include/c/cfloat b/libstdc++-v3/include/c/cfloat index 81d9772ed9f..1f9edada950 100644 --- a/libstdc++-v3/include/c/cfloat +++ b/libstdc++-v3/include/c/cfloat @@ -31,7 +31,12 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/climits b/libstdc++-v3/include/c/climits index 255bed41125..846fe190707 100644 --- a/libstdc++-v3/include/c/climits +++ b/libstdc++-v3/include/c/climits @@ -31,7 +31,12 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/clocale b/libstdc++-v3/include/c/clocale index 4258df1958b..62d85ed6609 100644 --- a/libstdc++-v3/include/c/clocale +++ b/libstdc++-v3/include/c/clocale @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cmath b/libstdc++-v3/include/c/cmath index 43020eee9d2..371ee59986c 100644 --- a/libstdc++-v3/include/c/cmath +++ b/libstdc++-v3/include/c/cmath @@ -33,8 +33,13 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + // Get rid of those macros defined in in lieu of real functions. #undef abs #undef div diff --git a/libstdc++-v3/include/c/csetjmp b/libstdc++-v3/include/c/csetjmp index 4a5b0334590..acf113a0c5a 100644 --- a/libstdc++-v3/include/c/csetjmp +++ b/libstdc++-v3/include/c/csetjmp @@ -31,8 +31,13 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + // Get rid of those macros defined in in lieu of real functions. #undef longjmp diff --git a/libstdc++-v3/include/c/csignal b/libstdc++-v3/include/c/csignal index 040b48368f9..c04bb6042f4 100644 --- a/libstdc++-v3/include/c/csignal +++ b/libstdc++-v3/include/c/csignal @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cstdarg b/libstdc++-v3/include/c/cstdarg index 5d97e043da8..7648662680c 100644 --- a/libstdc++-v3/include/c/cstdarg +++ b/libstdc++-v3/include/c/cstdarg @@ -31,7 +31,12 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #undef __need___va_list #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cstddef b/libstdc++-v3/include/c/cstddef index 4fd889a1dff..e1435b94556 100644 --- a/libstdc++-v3/include/c/cstddef +++ b/libstdc++-v3/include/c/cstddef @@ -31,10 +31,15 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #define __need_size_t #define __need_ptrdiff_t #define __need_NULL #define __need_offsetof #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cstdio b/libstdc++-v3/include/c/cstdio index 01293054d50..99aead4ef9c 100644 --- a/libstdc++-v3/include/c/cstdio +++ b/libstdc++-v3/include/c/cstdio @@ -31,8 +31,13 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + // Get rid of those macros defined in in lieu of real functions. #undef clearerr #undef fclose diff --git a/libstdc++-v3/include/c/cstdlib b/libstdc++-v3/include/c/cstdlib index f5707f8a8ce..75e6382c01b 100644 --- a/libstdc++-v3/include/c/cstdlib +++ b/libstdc++-v3/include/c/cstdlib @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cstring b/libstdc++-v3/include/c/cstring index 0082080fcab..05d75182a7a 100644 --- a/libstdc++-v3/include/c/cstring +++ b/libstdc++-v3/include/c/cstring @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/ctime b/libstdc++-v3/include/c/ctime index 5476ff7da39..73e2a7a0167 100644 --- a/libstdc++-v3/include/c/ctime +++ b/libstdc++-v3/include/c/ctime @@ -31,6 +31,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include_next +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c/cwchar b/libstdc++-v3/include/c/cwchar index 7a62eb74abb..921de267750 100644 --- a/libstdc++-v3/include/c/cwchar +++ b/libstdc++-v3/include/c/cwchar @@ -35,10 +35,15 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #if _GLIBCXX_HAVE_WCHAR_H #include_next #endif +#pragma GCC diagnostic pop + // Need to do a bit of trickery here with mbstate_t as char_traits // assumes it is in wchar.h, regardless of wchar_t specializations. #ifndef _GLIBCXX_HAVE_MBSTATE_T diff --git a/libstdc++-v3/include/c/cwctype b/libstdc++-v3/include/c/cwctype index 011ceadbb1b..0d2f55d9d6d 100644 --- a/libstdc++-v3/include/c/cwctype +++ b/libstdc++-v3/include/c/cwctype @@ -31,10 +31,15 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next + #include #if _GLIBCXX_HAVE_WCTYPE_H #include_next #endif +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c_global/climits b/libstdc++-v3/include/c_global/climits index 7e374ef0c79..c85fc283ae6 100644 --- a/libstdc++-v3/include/c_global/climits +++ b/libstdc++-v3/include/c_global/climits @@ -44,6 +44,9 @@ #ifndef _GLIBCXX_CLIMITS #define _GLIBCXX_CLIMITS 1 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" + #ifndef LLONG_MIN #define LLONG_MIN (-__LONG_LONG_MAX__ - 1) #endif @@ -56,4 +59,6 @@ #define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1) #endif +#pragma GCC diagnostic pop + #endif diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index dd0174f1987..4958dfd2ff1 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -43,9 +43,14 @@ #include #include #include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS #include_next #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS +#pragma GCC diagnostic pop + #include #ifndef _GLIBCXX_CMATH diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef index b25a6b3eec9..f49f56ae372 100644 --- a/libstdc++-v3/include/c_global/cstddef +++ b/libstdc++-v3/include/c_global/cstddef @@ -52,6 +52,9 @@ #define __glibcxx_want_byte #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 + extern "C++" { #if __cplusplus >= 201103L @@ -189,4 +192,6 @@ _GLIBCXX_END_NAMESPACE_VERSION #endif // __cpp_lib_byte } // extern "C++" +#pragma GCC diagnostic pop + #endif // _GLIBCXX_CSTDDEF diff --git a/libstdc++-v3/include/c_global/cstdlib b/libstdc++-v3/include/c_global/cstdlib index 69e7a39eb44..72baff24991 100644 --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -75,9 +75,13 @@ namespace std // Need to ensure this finds the C library's not a libstdc++ // wrapper that might already be installed later in the include search path. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // include_next #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS #include_next #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS +#pragma GCC diagnostic pop + #include // Get rid of those macros defined in in lieu of real functions. diff --git a/libstdc++-v3/include/decimal/decimal b/libstdc++-v3/include/decimal/decimal index d20e012f9c5..a64ddde4756 100644 --- a/libstdc++-v3/include/decimal/decimal +++ b/libstdc++-v3/include/decimal/decimal @@ -33,6 +33,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // DF suffix + #include #ifndef _GLIBCXX_USE_DECIMAL_FLOAT @@ -491,4 +494,5 @@ _GLIBCXX_END_NAMESPACE_VERSION #include +#pragma GCC diagnostic pop #endif /* _GLIBCXX_DECIMAL */ diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index b5ebb132274..19199e82806 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -66,6 +66,10 @@ #include // For uninitialized_copy_n +// Ignore warnings about default member initializers. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -3009,6 +3013,8 @@ namespace tr1 _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + # include #endif diff --git a/libstdc++-v3/include/std/any b/libstdc++-v3/include/std/any index 9ae29aab99f..d24260eaace 100644 --- a/libstdc++-v3/include/std/any +++ b/libstdc++-v3/include/std/any @@ -42,6 +42,9 @@ #include #include // in_place_type_t +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // aligned_storage + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -661,5 +664,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #endif // __cpp_lib_any #endif // _GLIBCXX_ANY diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv index 00c4f206922..de671393b88 100644 --- a/libstdc++-v3/include/std/charconv +++ b/libstdc++-v3/include/std/charconv @@ -31,6 +31,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 + #include // for error codes // As an extension we support in C++14, but this header should not @@ -932,4 +935,5 @@ namespace __detail _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // C++14 +#pragma GCC diagnostic pop #endif // _GLIBCXX_CHARCONV diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index be810b6d05d..c688d0cb728 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -38,6 +38,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // extern template + #include #include #include @@ -2650,4 +2653,5 @@ _GLIBCXX_END_NAMESPACE_VERSION #pragma clang diagnostic pop #endif +#pragma GCC diagnostic pop #endif /* _GLIBCXX_COMPLEX */ diff --git a/libstdc++-v3/include/std/coroutine b/libstdc++-v3/include/std/coroutine index ccd016b255e..30b4d33711e 100644 --- a/libstdc++-v3/include/std/coroutine +++ b/libstdc++-v3/include/std/coroutine @@ -31,6 +31,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++17-extensions" + #define __glibcxx_want_coroutine #include @@ -358,4 +361,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // __cpp_lib_coroutine +#pragma GCC diagnostic pop #endif // _GLIBCXX_COROUTINE diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 52243eb5479..88a42d1158a 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -63,6 +63,10 @@ # include #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 +#pragma GCC diagnostic ignored "-Wc++23-extensions" // bf16 + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -1674,6 +1678,10 @@ namespace __format do { + // Mangling of this lambda, and thus resize_and_overwrite + // instantiated with it, was fixed in ABI 18 (G++ 13). Since + // was new in G++ 13, and is experimental, that + // isn't a problem. auto __overwrite = [&__to_chars, &__res] (char* __p, size_t __n) { __res = __to_chars(__p + 1, __p + __n - 1); @@ -4734,4 +4742,5 @@ namespace __format _GLIBCXX_END_NAMESPACE_VERSION } // namespace std #endif // __cpp_lib_format +#pragma GCC diagnostic pop #endif // _GLIBCXX_FORMAT diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip index fdf80fc8b50..9d8ecea5d65 100644 --- a/libstdc++-v3/include/std/iomanip +++ b/libstdc++-v3/include/std/iomanip @@ -35,6 +35,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + #include // iostreams #include @@ -543,4 +546,5 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace +#pragma GCC diagnostic pop #endif /* _GLIBCXX_IOMANIP */ diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index 4b0698e4713..b0ab57c1ad7 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -39,6 +39,11 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // Q suffix +#pragma GCC diagnostic ignored "-Wlong-long" +#pragma GCC diagnostic ignored "-Wc++23-extensions" + #include // @@ -2229,4 +2234,5 @@ _GLIBCXX_END_NAMESPACE_VERSION #undef __glibcxx_digits10 #undef __glibcxx_max_digits10 +#pragma GCC diagnostic pop #endif // _GLIBCXX_NUMERIC_LIMITS diff --git a/libstdc++-v3/include/std/numbers b/libstdc++-v3/include/std/numbers index 9836afac645..f04000f1dd9 100644 --- a/libstdc++-v3/include/std/numbers +++ b/libstdc++-v3/include/std/numbers @@ -38,6 +38,9 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // Q extension + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -232,5 +235,7 @@ __glibcxx_numbers (__float128, Q); _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#pragma GCC diagnostic pop + #endif // __cpp_lib_math_constants #endif // _GLIBCXX_NUMBERS diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index 5fc808623a7..f2cd42bed4e 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -44,6 +44,10 @@ #include #include // for std::__addressof +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wvolatile" // volatile parm/return +#pragma GCC diagnostic ignored "-Wc++11-extensions" + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -2282,4 +2286,5 @@ namespace tr1 _GLIBCXX_END_NAMESPACE_VERSION } +#pragma GCC diagnostic pop #endif // _GLIBCXX_TR1_FUNCTIONAL diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple index be26d283f8c..40e2d091514 100644 --- a/libstdc++-v3/include/tr1/tuple +++ b/libstdc++-v3/include/tr1/tuple @@ -34,6 +34,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + #include // TR1 #include @@ -425,4 +428,5 @@ namespace tr1 _GLIBCXX_END_NAMESPACE_VERSION } +#pragma GCC diagnostic pop #endif // _GLIBCXX_TR1_TUPLE diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index f5714b0032c..62b30e7d658 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -31,6 +31,9 @@ #pragma GCC system_header +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" + #include // TR1 #include @@ -684,4 +687,5 @@ namespace tr1 _GLIBCXX_END_NAMESPACE_VERSION } +#pragma GCC diagnostic pop #endif // _GLIBCXX_TR1_TYPE_TRAITS diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index 63ad6b5c23e..ac8ffdb6c5a 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -39,6 +39,10 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" // __int128 +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + namespace std _GLIBCXX_VISIBILITY(default) { // [cmp.categories], comparison category types @@ -1258,6 +1262,8 @@ namespace std _GLIBCXX_VISIBILITY(default) #endif // __cpp_lib_three_way_comparison >= 201907L } // namespace std +#pragma GCC diagnostic pop + #endif // C++20 #endif // _COMPARE diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new index 2e2038e1a82..eaf1f502705 100644 --- a/libstdc++-v3/libsupc++/new +++ b/libstdc++-v3/libsupc++/new @@ -46,6 +46,9 @@ #define __glibcxx_want_constexpr_new #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wc++11-extensions" // scoped enum + #pragma GCC visibility push(default) extern "C++" { @@ -245,5 +248,6 @@ namespace std #endif // C++20 #pragma GCC visibility pop +#pragma GCC diagnostic pop #endif