On 09/23/2013 11:21 AM, Paul Eggert wrote: > On 09/23/13 08:40, Eric Blake wrote: > >> -fdiagnostics-show-option is very useful for gcc; perhaps we >> should tweak m4/manywarnings.m4 to add it to the set of warnings probed >> by default when gcc warnings are enabled > > I'm not familiar with that option. Isn't it the default behavior > for GCC nowadays?
Default for at least gcc 4.8.1 (Fedora 19)
$ echo 'int main() { }' > bar.c
$ gcc -Wall -o bar bar.c
bar.c: In function ‘main’:
bar.c:1:1: warning: control reaches end of non-void function [-Wreturn-type]
int main() { }
^
$ gcc --version | head -n1
gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
But lacking for gcc 4.4.7 (RHEL 6.4):
$ echo 'int main() { }' > bar.c
$ gcc -Wall -o bar bar.c
bar.c: In function ‘main’:
bar.c:1: warning: control reaches end of non-void function
$ gcc -Wall -o bar bar.c -fdiagnostics-show-option
bar.c: In function ‘main’:
bar.c:1: warning: control reaches end of non-void function [-Wreturn-type]
$ gcc --version | head -n1
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
