public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/98021] New: #warning issues redundant diagnostic lines
@ 2020-11-26 23:53 eggert at cs dot ucla.edu
  2020-11-27  0:03 ` [Bug preprocessor/98021] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: eggert at cs dot ucla.edu @ 2020-11-26 23:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98021
           Summary: #warning issues redundant diagnostic lines
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at cs dot ucla.edu
  Target Milestone: ---

I ran into this problem when building something from Gnulib. For the following
program foo.c:

#warning "GCC might issue a bogus -Wreturn-local-addr warning here."
#warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."

The command 'gcc -S foo.c' issues the following diagnostics, which are too
repetitive:

foo.c:1:2: warning: #warning "GCC might issue a bogus -Wreturn-local-addr
warning here." [-Wcpp]
    1 | #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
      |  ^~~~~~~
foo.c:2:2: warning: #warning "See
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." [-Wcpp]
    2 | #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
      |  ^~~~~~~

GCC should simply output something like this instead:

foo.c:1:2: warning: GCC might issue a bogus -Wreturn-local-addr warning here.
[-Wcpp]
foo.c:2:2: warning: See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>.
[-Wcpp]

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

end of thread, other threads:[~2021-02-10 20:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 23:53 [Bug preprocessor/98021] New: #warning issues redundant diagnostic lines eggert at cs dot ucla.edu
2020-11-27  0:03 ` [Bug preprocessor/98021] " pinskia at gcc dot gnu.org
2020-11-27  2:14 ` eggert at cs dot ucla.edu
2020-11-27  5:34 ` egallager at gcc dot gnu.org
2020-11-27  7:36 ` rguenth at gcc dot gnu.org
2020-11-27 11:18 ` schwab@linux-m68k.org
2020-11-27 11:54 ` schwab@linux-m68k.org
2020-11-28  1:30 ` eggert at cs dot ucla.edu
2020-11-28  8:11 ` schwab@linux-m68k.org
2020-11-28 17:28 ` eggert at cs dot ucla.edu
2020-11-28 17:52 ` schwab@linux-m68k.org
2020-11-28 18:54 ` eggert at cs dot ucla.edu
2020-11-28 19:45 ` schwab@linux-m68k.org
2020-11-28 20:29 ` eggert at cs dot ucla.edu
2020-11-28 21:06 ` schwab@linux-m68k.org
2020-11-29  1:23 ` eggert at cs dot ucla.edu
2020-11-29  8:09 ` schwab@linux-m68k.org
2021-02-10 20:37 ` dmalcolm 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).