This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12667] fscanf silently converts signed to unsigned
- From: "alexander.enchevich at yahoo dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 13 Apr 2011 06:59:54 +0000
- Subject: [Bug libc/12667] fscanf silently converts signed to unsigned
- Auto-submitted: auto-generated
- References: <bug-12667-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12667
--- Comment #7 from Alexander Enchevich <alexander.enchevich at yahoo dot com> 2011-04-13 06:59:44 UTC ---
You are correct in dismissing my bug report.
After reading the standard docs
(http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf) I can see that the
two excerpts are exactly as you quoted. I understand that this behaviour can
not be considered a bug under the current C standard; that the problem (if we
agree that this is a problem) is not of the implementation but of the design as
defined by the current C Standard; and I understand why you closed the bug
report and agree that it was the right thing to do.
My apologies - I thought I can rely on the man-pages but I guess I'll have to
revisit this assumption.. :)
cheers..
Alexander
--------
P.S. Andreas, just as a side note: I was wondering what is your personal
opinion on this matter and whether you agree that there is a flaw in the
current design of the scanf/strtoul functions?
In my view the current design does not allow programmers to reliably use the %u
type sequence to scan for unsigned numbers and forces them to use other means
of processing streams where input is expected but *not guaranteed* to follow
some predetermined structure. Therefore, IMHO, the designed behaviour of these
functions as defined by the current C standard, is flawed. (Whether it is a
good idea to "fix" this, given all the stakeholders, is a different story..)
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.