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]