[netcf-devel] [PATCH 2/3] build: silence compiler warning

Eric Blake eblake at redhat.com
Mon Jun 27 15:38:04 UTC 2011


On 06/27/2011 09:32 AM, Laine Stump wrote:
> On 06/27/2011 10:16 AM, Eric Blake wrote:
>>    CC     dutil_linux.lo
>> dutil_linux.c: In function ‘run_program’:
>> dutil_linux.c:201:11: warning: ‘childpid’ may be used uninitialized in this function
> 
> ACK and pushed.
> 
> I'm wondering why I don't see this warning though. Here's the 
> commandline (buried down in a script I never look at) I use to build netcf:
> 
> ./autogen.sh --enable-compile-warnings=error --prefix=/usr 
> --libdir=/usr/lib64 --disable-nls CFLAGS="-g -Wformat -Wformat-security 

-g without -O is the culprit.  Gcc doesn't warn about uninitialized
variables except at -O2.  You have to get smarter tools (like clang or
coverity) to get those warnings at all compilation levels. :(

I really wish gcc would improve in this regards, but it has been a known
open feature request for several years.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
Url : https://fedorahosted.org/pipermail/netcf-devel/attachments/20110627/a9ffb4c3/attachment.bin 


More information about the netcf-devel mailing list