missing format string in applets/usage_pod.c

Cathey, Jim jcathey at ciena.com
Mon Aug 18 18:50:41 UTC 2014


I don't like warnings on perfectly legal C.
Promoting them to errors is even worse.

That said, even with all this crap, provided
that the strings are constant and don't contain
substitutions the compiler has nothing to
complain about.

-- Jim

From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net] On Behalf Of Tanguy Pruvot
Sent: Thursday, August 14, 2014 6:45 AM
To: Laszlo Papp
Cc: waldeck at gmx.de; busybox
Subject: Re: Re: Re: missing format string in applets/usage_pod.c

its the same with bionic libc (arm)

printf("test") is ok but not printf(buf) with char buf[] = "test"; printf("%s", buf) is ok

2014-08-14 15:29 GMT+02:00 Laszlo Papp <lpapp at kde.org<mailto:lpapp at kde.org>>:
Sorry, the list was left out at some point due to my mistake ... See below.

On Thu, Aug 14, 2014 at 2:28 PM, Laszlo Papp <lpapp at kde.org<mailto:lpapp at kde.org>> wrote:
On Thu, Aug 14, 2014 at 2:04 PM, <waldeck at gmx.de<mailto:waldeck at gmx.de>> wrote:
Hi Laszlo,

> Cannot reproduce with -Wall -Wpedantic -Wextra.
Did you notice:
applets/usage_pod.c:74:3: error: format not a string literal and no format arguments
[-Werror=format-security]
^^^^^^^^^^^^^^^^?

Hmm, yes, but I got used to that -Wall -Wpedantic -Wextra would cover the cases that need to be checked. I am not sure this option respects the C language though.

Anyway, I guess I learnt something new today, thanks. :-)


_______________________________________________
busybox mailing list
busybox at busybox.net<mailto:busybox at busybox.net>
http://lists.busybox.net/mailman/listinfo/busybox

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20140818/c1948f7c/attachment.html>


More information about the busybox mailing list