From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 004F33858D1E for ; Fri, 30 Sep 2022 16:00:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 004F33858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x432.google.com with SMTP id m4so7504131wrr.5 for ; Fri, 30 Sep 2022 09:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject :date; bh=n3RTgm8hwCs6Qmy7StlRitmVjf8qbiHyuisgRbyrrOo=; b=TvmPfoDlkNjEG/XTm2+BJFTAIyC0MibZGyB/es2zIAZq/bh9uK+94DrWiq2hb4zuQh g7Sy7+nS/CWcMnL6kmzUpjuD7skN9y3XET8GuOCmcwylpDbWsi+MUwsOziourHSdlx4s ixogHU/mwMzLZqeg+H5Jv4flYrnBZDrAIqtrCMq9ehm/LgseC0Uc+9TmIO+DAy8IqIyB upSADbYPLTrOIJaJaCKCtHOabrx9c4qVMfoqjhozEnFGlRVtJxI0Ul0jaESkB0Wi8b6t 9zPcK4p2f6wV1SygEI0mgTKXcCo4sO7xSlqJNqRijMqNG4QmdZmf1Ew+iE0fZkNVl0Ez +Dig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date; bh=n3RTgm8hwCs6Qmy7StlRitmVjf8qbiHyuisgRbyrrOo=; b=bcaP5X1I/XFy96IQC6p4vCrvWRoS4Ri/7i2yy9BpZJb/eZzVz/anfXvYIZX1kqMs7g gbprVmUUseiloP4SOOWC7d3+rk4cPbZy6MSCh5e4cRJBS983lS0gbFZKO50HFY4NJQYn vlh3NCVoIcw+0M1N/ilbtN3tFd7dMTniFBA1xsrNJe1dUHJ69ii29uttcGFSx8OiMySA l6OdocZLMFALaqa05DvC8apSENP+k827qxMl7V7DBJVWr29eWFiKFdM0YesxN8sOFRqi x+fS2PSWd+WoC6iVRBmIzibhZZ9n8B8yfMhgyfx/iRzoyQn/NLDAy9Bh3waLyxSD/kt8 MOIw== X-Gm-Message-State: ACrzQf0fB5xCcchND+kow573UMraC7V/dplua8HigTsBDnnYrwVZpscO D5WRpfUOlxxPCJU+UlXC0mL74IHd4Y9l+A== X-Google-Smtp-Source: AMsMyM41Ca8tLICRrF35basnn3gcp3r0AMJ3oy41fki1levSLsk84tA1C8ty7jAxVDlCD0OuSJYxGQ== X-Received: by 2002:a5d:5b18:0:b0:22b:1c7:6f8 with SMTP id bx24-20020a5d5b18000000b0022b01c706f8mr6267523wrb.502.1664553601774; Fri, 30 Sep 2022 09:00:01 -0700 (PDT) Received: from smtpclient.apple ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id fc9-20020a05600c524900b003b31c560a0csm2639535wmb.12.2022.09.30.09.00.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2022 09:00:00 -0700 (PDT) From: Olivier Hainque Content-Type: multipart/mixed; boundary="Apple-Mail=_6F88F248-FF82-4EFE-87EC-14673DFE3343" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: [patch] Prevent secondary warning from diagnostic tweak in gthr-vxworks.h Message-Id: <54C14E56-2BC8-4F58-AF84-BAB4F463F531@adacore.com> Date: Fri, 30 Sep 2022 17:59:59 +0200 Cc: Olivier Hainque To: gcc-patches X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: --Apple-Mail=_6F88F248-FF82-4EFE-87EC-14673DFE3343 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Within gthr-vxworks.h, we prevent C++ errors from missing declarations in some system headers by prepending their inclusion with a #pragma GCC diagnostic ignored "-Wstrict-prototypes" But Wstrict-prototypes is internally registered as valid for C/ObjC only, not C++, and this trick in turn triggers a Wpragma warning with -Wsystem-headers. This change just arranges to ignore the secondary warning locally. We have been using this for a while with gcc-11 based toolchains, where the only effect was the intended disappearance of a test failure observed on g++.dg/warn/Wstringop-overflow-6.C. Sanity checked with a build + basic testing with a gcc-12 compiler, then a mainline build for arm-vxworks7r2. Cheers Olivier 2021-02-03 Olivier Hainque * config/gthr-vxworks.h: Prevent Wpragma warning for the pragma diagnostics on Wstrict-prototypes. --Apple-Mail=_6F88F248-FF82-4EFE-87EC-14673DFE3343 Content-Disposition: attachment; filename=0010-Prevent-secondary-warning-from-diagnostic-tweak-in-g.patch Content-Type: application/octet-stream; x-unix-mode=0640; name="0010-Prevent-secondary-warning-from-diagnostic-tweak-in-g.patch" Content-Transfer-Encoding: quoted-printable =46rom=2097e4ee1d69a350e8e4bac25265e27f207baf2850=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Olivier=20Hainque=20=0A= Date:=20Thu,=203=20Feb=202022=2015:57:32=20+0000=0ASubject:=20[PATCH=20= 10/18]=20Prevent=20secondary=20warning=20from=20diagnostic=20tweak=20in=0A= =20gthr-vxworks.h=0A=0AWithin=20gthr-vxworks.h,=20we=20prevent=20C++=20= errors=20from=20missing=0Adeclarations=20in=20some=20system=20headers=20= by=20prepending=20their=20inclusion=0Awith=20a=0A=0A=20=20=20=20#pragma=20= GCC=20diagnostic=20ignored=20"-Wstrict-prototypes"=0A=0ABut=20= Wstrict-prototypes=20is=20internally=20registered=20as=20valid=20for=0A= C/ObjC=20only,=20not=20C++,=20and=20this=20trick=20in=20turn=20triggers=20= a=20Wpragma=0Awarning=20with=20-Wsystem-headers.=0A=0AThis=20change=20= just=20arranges=20to=20ignore=20the=20secondary=20warning=20locally.=0A=0A= 2021-02-03=20=20Olivier=20Hainque=20=20=0A=0A=09*=20= config/gthr-vxworks.h:=20Prevent=20Wpragma=20warning=20for=20the=0A=09= pragma=20diagnostics=20on=20Wstrict-prototypes.=0A---=0A=20= libgcc/config/gthr-vxworks.h=20|=205=20++++-=0A=201=20file=20changed,=20= 4=20insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/libgcc/config/gthr-vxworks.h=20b/libgcc/config/gthr-vxworks.h=0Aindex=20= 9861a11511a..31c4b9f2557=20100644=0A---=20a/libgcc/config/gthr-vxworks.h=0A= +++=20b/libgcc/config/gthr-vxworks.h=0A@@=20-38,8=20+38,11=20@@=20see=20= the=20files=20COPYING3=20and=20COPYING.RUNTIME=20respectively.=20=20If=20= not,=20see=0A=20#include=20<_vxworks-versions.h>=0A=20=0A=20/*=20Some=20= VxWorks=20headers=20profusely=20use=20typedefs=20of=20a=20pointer=20to=20= a=20function=20with=0A-=20=20=20undefined=20number=20of=20arguments.=20=20= */=0A+=20=20=20undefined=20number=20of=20arguments.=20=20Arrange=20to=20= ignore=20declaration=20errors=20in=20C++,=0A+=20=20=20which=20is=20= achievable=20by=20ignoring=20Wstrict-prototypes=20diagnostics=20even=20= when=20the=0A+=20=20=20option=20is=20registered=20as=20only=20valid=20= for=20c/objc.=20=20*/=0A=20#pragma=20GCC=20diagnostic=20push=0A+=20=20= #pragma=20GCC=20diagnostic=20ignored=20"-Wpragmas"=0A=20=20=20#pragma=20= GCC=20diagnostic=20ignored=20"-Wstrict-prototypes"=0A=20=20=20#include=20= =0A=20#pragma=20GCC=20diagnostic=20pop=0A--=20=0A2.25.1=0A=0A= --Apple-Mail=_6F88F248-FF82-4EFE-87EC-14673DFE3343 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_6F88F248-FF82-4EFE-87EC-14673DFE3343--