On Mon, Aug 18, 2014 at 7:50 PM, Cathey, Jim <[email protected]> wrote:

> 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.
>

It is not just about the warning and error, but the actual usage, too: if
you do not need a placeholder, why would you use printf in the first place?
It is not really meant for that. f/puts, on the other hand, were
established for that. While, it is "perfectly legal" C, like so many other
things that C sadly allows, it does not make much sense to me either. Note
that "perfectly legal" can be quite far from "perfectly reasonable".


>
>
> -- Jim
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Tanguy Pruvot
> *Sent:* Thursday, August 14, 2014 6:45 AM
> *To:* Laszlo Papp
> *Cc:* [email protected]; 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 <[email protected]>:
>
> 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 <[email protected]> wrote:
>
> On Thu, Aug 14, 2014 at 2:04 PM, <[email protected]> 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
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
>
>
>
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to