bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-fdiagnostics-show-option [was: [ANN] m4-1.4.17 released [stable]]


From: Eric Blake
Subject: -fdiagnostics-show-option [was: [ANN] m4-1.4.17 released [stable]]
Date: Mon, 23 Sep 2013 11:51:00 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]