public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/106947] New: -Waddress + bool + pragma generates meaningless diagnostic
@ 2022-09-14 20:31 eggert at cs dot ucla.edu
  2022-09-14 20:39 ` [Bug c/106947] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: eggert at cs dot ucla.edu @ 2022-09-14 20:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106947

            Bug ID: 106947
           Summary: -Waddress + bool + pragma generates meaningless
                    diagnostic
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

I found this while testing Gnulib with gcc (GCC) 12.1.1 20220507 (Red Hat
12.1.1-1) on x86-64.

Compile the following with "gcc -Waddress -S t.c":

#pragma GCC diagnostic ignored "-Waddress"
int s;
_Bool e = &s;
int
main ()
{
  int error = 0;
  {
    _Bool e1 = &s;
    if (!e1)
      error = 1;
  }
  return error;
}

The output is the meaningless diagnostic:

t.c: In function ‘main’:
t.c:2:5: note: ‘s’ declared here
    2 | int s;
      |     ^

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-16 12:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 20:31 [Bug middle-end/106947] New: -Waddress + bool + pragma generates meaningless diagnostic eggert at cs dot ucla.edu
2022-09-14 20:39 ` [Bug c/106947] " pinskia at gcc dot gnu.org
2022-09-14 20:39 ` pinskia at gcc dot gnu.org
2022-09-14 20:42 ` [Bug c/106947] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-09-15  7:19 ` rguenth at gcc dot gnu.org
2022-09-15 15:19 ` mpolacek at gcc dot gnu.org
2022-09-19 18:41 ` cvs-commit at gcc dot gnu.org
2022-09-19 18:43 ` cvs-commit at gcc dot gnu.org
2022-09-19 18:43 ` mpolacek at gcc dot gnu.org
2023-03-16 12:25 ` marxin at gcc dot gnu.org

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).