Email List: Xaustin-group-lX
[All Lists]

scanf and ERANGE

To: austin-group-l@xxxxxxxxxxxxx
Subject: scanf and ERANGE
From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
Date: Fri, 20 Jun 2008 16:49:43 +0100
Hiya,

I can see GNU libc and uclibc scanf set errno to ERANGE upon a
%u, %i (and possibly %e, %f... as well) conversion that ends up
%overflowing the number size.

Solaris 10 man page suggests it's also the case there for %a,
%e, %f, %g (though not in the ERROR section).

Shouldn't it be something that should be mentionned in the
standard, i.e. that errno _may_ be set to ERANGE, but that a
conformant application can't rely on it to check for overflow?

Best regards,
Stéphane

<Prev in Thread] Current Thread [Next in Thread>