GNU bug report logs -
#12164
What is the right way to specify -Wno-format-contains-nul?
Previous Next
Reported by: Bruce Korb <bruce.korb <at> gmail.com>
Date: Thu, 9 Aug 2012 20:07:02 UTC
Severity: wishlist
Tags: wontfix
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
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
This bug report was last modified 11 years and 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.