Re: printf behaviour with illegal or malformed format string



In message <200512121643.39236.max@xxxxxxxxxxxxxx>, Max Laier writes:

>I agree on principle but would like to ask if we need to revisit some of the
>error cases. Especially with regard to 64bit porting there are some
>"artifacts" that might cause serious pain for ported applications if the
>above is adopted.
>
>Specifically, right now the following will warn "long long int format, int64_t
>arg (arg 2)" on our 64bit architectures while it is required on - at least i386
>
> int64_t i = 1;
> printf("%lld", i);

You misunderstood me.

"%lld" is a legal formatting string, my printf implementation would never
object to that.

I'm talking about illegal/non-sensical formatting strings like "%lhd" or
even "%!!!!d" and similar.

The issue you raise is valid and important, but it is not for this bikeshed ;-)

Poul-Henning

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@xxxxxxxxxxx | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"