[Top][All Lists]

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

bug#12164: What is the right way to specify -Wno-format-contains-nul?

From: Bruce Korb
Subject: bug#12164: What is the right way to specify -Wno-format-contains-nul?
Date: Thu, 09 Aug 2012 12:58:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0


It seems that AM_PROG_CC likes to default CFLAGS to "-g -Wall" and
COMPILE puts CFLAGS at the end of the option list.  That means
that -Wall over-rides my AM_CFLAGS setting and chokes and dies.
My library uses a large array of bytes to hold many strings,
some of which are formatting strings and gcc is really clever about
noticing that there are embedded NUL bytes separating each substring.
(I actually added -Wno-format-contains-nul shortly after this new
cleverness was added...)  The deal is that if someone does a:

   make CFLAGS='-Dsomethingforme -Wall'

and I were to add this nul thingey to the end of CFLAGS, then
my effort is for naught.  I think it useful to have a PROJECT_CFLAGS
that always gets stuck at the end in the COMPILE macro.

Meanwhile, I'll specify it twice -- once in CFLAGS and again in AM_CFLAGS
in hopes it remains active regardless.

(Actually, gcc probably ought not override a specifically set option
with a "-Wall", but this the wrong forum for that...)

Thanks - Bruce

reply via email to

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