[libvirt] 141 format string warnings

Jim Meyering jim at meyering.net
Wed Oct 8 10:07:17 UTC 2008

"Daniel P. Berrange" <berrange at redhat.com> wrote:

> On Wed, Oct 08, 2008 at 11:47:33AM +0200, Jim Meyering wrote:
>> Hello,
>> I count 141 warnings like this:
>>   util.c:177: warning: format not a string literal and no format arguments
>> If anyone is in the process of fixing those, please let me know soon.
> What compile options are you using ? I run with --enable-compile-warnings=error
> and it all passes

I did something like this:

test -f makerr && backup makerr; (date; ./configure \
--disable-nls --disable-shared --enable-test-coverage \
CFLAGS='-O2 -g -Wformat -Wformat-security -Winit-self -Wall -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -Dlint' && make && make check && make distcheck; date ) >& makerr & tail -F makerr

Disabling nls makes it so _() is a no-op, and that exposes
the otherwise-hidden-from-gcc's-perspective literal format
strings for analysis.

More information about the libvir-list mailing list