public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "antiquarktv at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97829] New: pragma ignore "-Wint-in-bool-context" is ignored for _Bool _Complex interaction Date: Sat, 14 Nov 2020 17:52:38 +0000 [thread overview] Message-ID: <bug-97829-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97829 Bug ID: 97829 Summary: pragma ignore "-Wint-in-bool-context" is ignored for _Bool _Complex interaction Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: antiquarktv at gmail dot com Target Milestone: --- #include <stdio.h> #include <stdlib.h> // gcc -std=c11 -Wall -Wextra -pedantic main.c #pragma GCC diagnostic ignored "-Wint-in-bool-context" #pragma GCC diagnostic ignored "-Wunused-variable" int main() { double _Complex x = 1; _Bool b = 1; b *= x; // prints int-in-bool-context warning. _Bool c = 2; // unused var warning not printed. } /* The code above prints the following when compiled: gcc -std=c11 -Wall -Wextra -pedantic main.c main.c: In function ‘main’: cc1: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] cc1: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context] The Wint-in-bool-context warning is printed by cc1 as a result of the _Bool *= _Complex operation If this code is compiled with -Wno-int-in-bool-context on the command line, there is no warning: gcc -std=c11 -Wall -Wextra -pedantic main.c -Wno-int-in-bool-context (produces no output). */
reply other threads:[~2020-11-14 17:52 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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-97829-4@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).