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:
> 
> > 1. When did "%D" become invalid?
> 
> It never was valid after libc4 according to the reporter.  I do not
> even know where this came from.

FWIW, both Solaris and HP-UX treat it as "%ld".

> 
> > 2. What should
> > 
> > sscanf ("12345", "%Z", &x)
> > 
> > return? Both Solaris and HP-UX return 0 when the format specifier is
> > invalid.
> 
> The problem is that invalid formats are then unrecognizable from those
> which haven't performed any assignment:
> 
> 	sscanf ("12345", "%*Z", &x)
> 
> You'll never know when the call failed because of an invalid format
> string since it also returns 0 if it is successful.
> 
> The ISO standard leaves this completely unspecified.
> 

If that is case, I would say we should follow what others do and
most of all we don't change any existing behavior.


-- 
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]