]> git.ipfire.org Git - thirdparty/libvirt.git/commit
maint: turn on gcc logical-op checking
authorEric Blake <eblake@redhat.com>
Fri, 23 Jul 2010 20:28:31 +0000 (14:28 -0600)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 28 Jul 2010 13:25:36 +0000 (15:25 +0200)
commit40e973dd00e5a4a22f0f8ae0cb18168d4a5304e2
tree90b9f1441deed9c1659e1e4506c5dfd14c7c2171
parente5360d0bfead27973bae150b7b61f96b2ad4ad00
maint: turn on gcc logical-op checking

This would have detected the bug in commit 38ad33931 (Aug 09), which
we missed until commit f828ca35 (Jul 10); over 11 months later.

However, on Fedora 13, it also triggers LOTS of warnings from
the libcurl-devel header for two files:

esx/esx_vi.c: In function 'esxVI_CURL_Perform':
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
...
xenapi/xenapi_driver.c: In function 'call_func':
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
...

libcurl allows to disable the type-checking code that triggers those
warnings, along with the reduction in type-safety of calls to some
libcurl functions. I figure this is worth the improved compiler
checking throughout the rest of libvirt.

* acinclude.m4 (--enable-compile-warnings=error): Add -Wlogical-op.
* configure.ac: Add -DCURL_DISABLE_TYPECHECK to LIBCURL_CFLAGS to
avoid compilation warning.

Suggested by Daniel P. Berrange.
Tweaked by Matthias Bolte.
acinclude.m4
configure.ac