This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why this change?


> 
> hjl@lucon.org (H.J. Lu) writes:
> 
> > Could you please tell me why this change
> > 
> > 1998-11-13  Ulrich Drepper  <drepper@cygnus.com>
> > 
> >         * stdio-common/vfscanf.c: Return EOF for invalid format
> >         characters.
> > 
> > is needed? It breaks stdio-common/tstdiomisc.c. Do you have a testcase
> > for the bug you tried to fix?
> 
> The problem is that some old code contains format specifiers which are
> invalid today.  E.g., scanf ("%D", ...) used to be the same as "%ld".
> When we do not signal an error these kinds of errors stay unnoticed.

1. When did "%D" become invalid?
2. What should

sscanf ("12345", "%Z", &x)

return? Both Solaris and HP-UX return 0 when the format specifier is
invalid.


-- 
H.J. Lu (hjl@gnu.org)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]