GCC 4.x has the option "-fdiagnostics-show-option", which displays the option used to disable the warning:
$ gcc -fdiagnostics-show-option foo.c -Wall -o foo foo.c: In function 'main': foo.c:3: warning: unused variable 'x' [-Wunused-variable] foo.c:4: warning: control reaches end of non-void function
If you need to parse a warning, this can simplify the situation (especially if there are localized error messages).
JesperE
source share