From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F86B384AB6C; Wed, 15 May 2024 06:55:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F86B384AB6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715756100; bh=CWJzS1Q0YrDeBviL6qg44QbtoyKH4JFKkEMX/T69hqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SSenxbzrIm1qtkcgi6V5KBAPmKtq1jwiW6//Oj7aqlQgVIJOZqbEUfTgWA9r/1eoc reckaERq1U4QJYUlTmWxRNrhD1senWlpThTMkkXC8WaFnVCu72wTsnCF2EP8K3Xs9b 1/vvlL1230+Cdpi5um8DR2UT+WL9WspGGC/z8kb4= From: "alx at kernel dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/95024] want a way to turn off -Werror for a specific diagnostic but only emit an warning if it was turned on before hand Date: Wed, 15 May 2024 06:54:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.1.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: alx at kernel dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95024 --- Comment #4 from Alejandro Colomar --- Sorry, I didn't make it clear; I somehow forgot about it. Here's the problem: $ cat err.c=20 int main(void) { short s; int *p; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wno-error=3Dincompatible-pointer-types" p =3D &s; #pragma GCC diagnostic pop } $ gcc err.c=20 err.c: In function =E2=80=98main=E2=80=99: err.c:8:32: warning: unknown option after =E2=80=98#pragma GCC diagnostic= =E2=80=99 kind [-Wpragmas] 8 | #pragma GCC diagnostic ignored "-Wno-error=3Dincompatible-pointer-t= ypes" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~ err.c:8:32: note: did you mean =E2=80=98-Wno-incompatible-pointer-types=E2= =80=99? err.c:9:11: warning: assignment to =E2=80=98int *=E2=80=99 from incompatibl= e pointer type =E2=80=98short int *=E2=80=99 [-Wincompatible-pointer-types] 9 | p =3D &s; | ^=