From patchwork Wed May 17 19:06:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 95497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1360482vqo; Wed, 17 May 2023 12:08:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Dv5DOyawxgPoT5f6NuFKR65KW9e2lB1ro0pSnPmCpJJXg5GqnieZqAqcqKa8ShaLJlE1q X-Received: by 2002:a17:907:9304:b0:94a:7716:e649 with SMTP id bu4-20020a170907930400b0094a7716e649mr37354275ejc.13.1684350517510; Wed, 17 May 2023 12:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684350517; cv=none; d=google.com; s=arc-20160816; b=ww4N+MjlUoDRGO+BrHs9T04PnjGk6TWEgAIjwI2CuN/HE06ksBAJdETSvSaEuIucOM HINn+MNXEsYFDORMePRljO6nqJjdAmWywkQIJ4pZA0KB1qJ4B7L39ZQe/z50gYtaf1m9 FJfLmjeDSCbHmk3oRduIOqh8tC4FcPKQxiVVIMVxjR0MfXoPi/agyJgrX5no3SkwHDD+ jH+OrN96LHVLz1LPWvp74drHvwD1drih53uN9944LxcC2SJvFMj7dZwHCJvcozL7eSwx ttpvptWj/z03UNjAqe05TuylVOqqtC1r/QBsgwiKDxeJZPt+zLKTjohUG57MiPIQFv/c fF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=zjXahUPOFWSiouULnv+pa6UXcREAcmHl7WI8Cp18fuI=; b=ct0kU32PmToVmHQxGrcxZeJHbRFGC65x+zzZY1Nf0edm6JlikoremYgnhgCpjnkScd 7XCetWxyUkEbo+U/51VvG9MErCw/jaBsEi73Y5Jl800CAE2USrHhM5MdBco7/NycbsRi BkMAn/jP7nWT0zP8SBAtXsjOhr66rErvQ+3/0UBRy3MR2DvWlWHm82grn6x/+W1/han9 jBynD/BF9j+PqIrto4pmojoR0JcgroLK60O8Scdg6IWSIBNvcsXgABx3Gkms6xl2ript eA6WUqacMzmnjUIo6MLFC3qVgVdqhekpvXSl49qeDsi43RMULPaLH4XZvdb2wV3oE6GC c4rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cStIBm+l; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d19-20020a1709061f5300b009662c796238si15998130ejk.1010.2023.05.17.12.08.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 12:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=cStIBm+l; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8214C3839067 for ; Wed, 17 May 2023 19:07:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8214C3839067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684350444; bh=zjXahUPOFWSiouULnv+pa6UXcREAcmHl7WI8Cp18fuI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cStIBm+lGK3/X7a5nnxQ+hlDkQbesOFEtLkfFLHswO3Pbc7KuUka6vqFdHrzzpE4V TrDxQG+FHVgU1jyW11iTT3ct5DEzWH02oUwBdi/92AAbDe0LjVbbu1nTr/NQ7CdaZj rgI7yrc1v25DyaGLmx59KQGZt2jgUjLJcGT3kTak= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id A629A384645F for ; Wed, 17 May 2023 19:06:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A629A384645F Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-Ug7TYCzxPGCMlFPEalOBMA-1; Wed, 17 May 2023 15:06:09 -0400 X-MC-Unique: Ug7TYCzxPGCMlFPEalOBMA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9DCC3C0C880; Wed, 17 May 2023 19:06:08 +0000 (UTC) Received: from localhost (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 954442026D16; Wed, 17 May 2023 19:06:08 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add system_header pragma to Date: Wed, 17 May 2023 20:06:07 +0100 Message-Id: <20230517190607.2023676-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766169528019706544?= X-GMAIL-MSGID: =?utf-8?q?1766169528019706544?= Tested powerpc64le-linux. Pushed to trunk. -- >8 -- 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 directly (rather than via another header like ). If 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 , but that's not necessary for now. libstdc++-v3/ChangeLog: * include/bits/c++config: Add system_header pragma. --- libstdc++-v3/include/bits/c++config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 13892787e09..009a017b048 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -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