This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: Why this change?
- To: drepper@cygnus.com
- Subject: Re: Why this change?
- From: hjl@lucon.org (H.J. Lu)
- Date: Fri, 13 Nov 1998 19:20:26 -0800 (PST)
- Cc: libc-hacker@cygnus.com
>
> 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)