On 06/19/2012 04:00 AM, Eric Blake wrote:
On 06/18/2012 07:27 PM, John Spencer wrote:
It's nice to be
able to print a floating point value retrieved from a file,
even if the file got messed up somehow,
ack.
That argues that printf() should be robust to _everything_ you throw at
it, even bit patterns that are not produced by arithmetic.
neither me nor paul were talking about printf().
and apparently the standard differs from your interpretation.
those bit patterns are UB and therefore can be left unhandled.
remember: gnulib checks for "POSIX compliant printf", then produces said
UB and declares a perfectly conformant implementation broken.
and to have that
work reliably. I'm willing to have my programs be
0.00....01% slower if I can get that extra reliability.
maybe you, but not me.
and i definitely don't want 2 different printf implementations in my
binary because of this silly cornercase.
You don't need 2 different printf implementations, just one that
robustly handles all possible input.
no, i don't need that. if the guys that wrote the C99 spec were fine
with UB, i'm fine with it as well.
who uses LD80 values in files anyway ?
Who cares? POSIX requires od to support it, and that should be enough
for libc to support it.
if POSIX requires od to support it, od should handle it.
where did you get the impression that the libc should do this for you ?
that's completely bogus.