public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "alx at kernel dot org" <gcc-bugzilla@gcc.gnu.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 [thread overview] Message-ID: <bug-95024-4-UnL4Ows4JS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-95024-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95024 --- Comment #4 from Alejandro Colomar <alx at kernel dot org> --- Sorry, I didn't make it clear; I somehow forgot about it. Here's the problem: $ cat err.c int main(void) { short s; int *p; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wno-error=incompatible-pointer-types" p = &s; #pragma GCC diagnostic pop } $ gcc err.c err.c: In function ‘main’: err.c:8:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas] 8 | #pragma GCC diagnostic ignored "-Wno-error=incompatible-pointer-types" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ err.c:8:32: note: did you mean ‘-Wno-incompatible-pointer-types’? err.c:9:11: warning: assignment to ‘int *’ from incompatible pointer type ‘short int *’ [-Wincompatible-pointer-types] 9 | p = &s; | ^
prev parent reply other threads:[~2024-05-15 6:55 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-09 19:33 [Bug c/95024] New: No way to pass "-Wno-error=..." with #pragma GCC diagnostic colomar.6.4.3 at gmail dot com 2020-05-09 20:02 ` [Bug c/95024] " pinskia at gcc dot gnu.org 2020-05-09 21:30 ` colomar.6.4.3 at gmail dot com 2020-05-10 1:17 ` pinskia at gcc dot gnu.org 2024-05-15 6:54 ` alx at kernel dot org [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-95024-4-UnL4Ows4JS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).