bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strptime() : porting to AIX problem


From: Andreas Jaeger
Subject: Re: strptime() : porting to AIX problem
Date: Fri, 02 Nov 2001 09:09:36 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux)

<address@hidden>(Walter Harms) writes:

> hi list,
> While porting a glibc application to AIX i found a incompartibility in 
> strptime().
> This was discussed recently on comp.sys.aix. I thing the results should be 
> noted in the info/man-pages because it may concern more systems than just AIX.
>
> jon wrote a variation on my org. theme:
> /* 
> from: address@hidden (Jon Parmet)
> */
>
> #include <time.h>
> #include <stdio.h>
>
> main()
> {
> struct tm the_time;
> char tt[20];
> strcpy(tt,"23102001233300");
> strptime(tt,"%d%m%Y%H%M%S",&the_time);
> puts(asctime(&the_time));
> }
> the output produced is:
> Sun Jan  0 00:00:80 1900
>
> It works fine with glibc6, but the AIX guy have also there point:
>
> /* again: jon@ */
>
>
> FWIW, the Single-Unix specification for strptime says:
> http://www.opengroup.org/onlinepubs/007908799/xsh/strptime.html
> The format is composed of zero or more directives. Each
> directive is composed of one of the following: one or more
> white-space characters (as specified by isspace(); an ordinary
> character (neither % nor a white-space character); or a
> conversion specification. Each conversion specification is
> composed of a % character followed by a conversion character
> which specifies the replacement required. There must be
> white-space or other non-alphanumeric characters between any
> two conversion specifications. ...

The AustinDraft specifies: "The application shall ensure that there is
white-space...".  But does not mention what happens in case that there
is nothing between the conversion specifiers.  Both behaviours
therefore seem consistent with the specification.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs address@hidden
   private address@hidden
    http://www.suse.de/~aj



reply via email to

[Prev in Thread] Current Thread [Next in Thread]