On 2009-06-17 21:21:05 -0700, Rob Browning wrote:
> Michael Bienia <mich...@vorlon.ping.de> writes:
> 
> > As Ubuntu's gcc has some hardening patches applied, lockfile-progs
> > 0.1.11-0.1 fails to build in Ubuntu intrepid with the following error
> > message:
> > ,----
> > | lockfile-progs.c: In function 'usage':
> > | lockfile-progs.c:79: error: format not a string literal and no format 
> > arguments
> > `----
> > I hope your are interested in a patch fixing it (patch attached).
> 
> Hmm.  Perhaps the usage_str should be a const char*, but is it actually a
> bug for a format string style function to not have any arguments?

I guess the problem is that gcc can't check if the passed string
contains any format specifier or not (see -Wformat-security in the gcc
manpage. This option is enabled in Ubuntu's gcc by default).

> I'd be happy to change it to a const char* if that helps.

I've checked this and making usage_str a "const char *" isn't enough and
still needs the "%s" in the msg() call. But what works is replacing the
assignments to usage_str with calls to msg() (and making so usage_str
unnecessary).

Michael



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to