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

--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 15 Jun 2018, lopezibanez at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86134
> 
> --- Comment #7 from Manuel López-Ibáñez <lopezibanez at gmail dot com> ---
> What I'm suggesting is to add an option to control this warning, which is
> currently enabled by default. Then you can use -Wno-error or even -Wno- to
> make it always a warning or completely disable it. This what clang does.

That sounds reasonable but then don't you have a chicken-and-egg
issue because you'd need to say

 -Wno-unknown-warning-option

which when not known in old compilers will cause the very same issue
with -Werror ...

What's bad about changing the diagnostic to be emitted as a note
after the very first warning that is emitted?  So

> echo 'int main(){}' | gcc -S -x c -Wno-unknown-warning-option -Wall 
-Werror -Wno-error=return-type -
<stdin>: In function ‘main’:
<stdin>:1:1: warning: control reaches end of non-void function 
[-Wreturn-type]
<stdin>: note: unrecognized command line option "-Wno-unknown-warning-option"
may have silenced this or further diagnostics
...

?  Which also makes the intent of the warning more explicit.

Reply via email to