List of extensions in strptime(3) man page incorrect

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

List of extensions in strptime(3) man page incorrect

Andras Farkas
OpenBSD's man page for strptime(3) states in the Standards section:
The `%G', `%g', `%s', `%u', `%V', `%Y', and `%Z' conversion
specifications are extensions.
However, %Y is not an extension.  It is part of the standard.
There are also extensions not listed there that should be:
%F, %k, %l (lowercase L), %z

https://man.openbsd.org/strptime.3
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html

However, my email may not be fully meaningful.  Also in the Standards
section of the man page is:
The strptime() function conforms to X/Open Portability Guide Issue 4,
Version 2 ("XPG4.2").
I instead looked at the most recent version of that standard (XPG7)
since I don't know if the old version specified there is still
available online.  In the past I've been able to find XPG7, XPG6,
XPG5, and XPG2 online.  Only XPG7 and XPG6 are easy to find.

Reply | Threaded
Open this post in threaded view
|

Re: List of extensions in strptime(3) man page incorrect

Ingo Schwarze
Hi Andras,

Andras Farkas wrote on Fri, Jul 19, 2019 at 12:53:16PM -0400:

> OpenBSD's man page for strptime(3) states in the Standards section:
> The `%G', `%g', `%s', `%u', `%V', `%Y', and `%Z' conversion
> specifications are extensions.
>
> However, %Y is not an extension.  It is part of the standard.
> There are also extensions not listed there that should be:
> %F, %k, %l (lowercase L), %z

I just committed the patch below, correcting the list as you suggested.

> However, my email may not be fully meaningful.  Also in the Standards
> section of the man page is:
> The strptime() function conforms to X/Open Portability Guide Issue 4,
> Version 2 ("XPG4.2").
> I instead looked at the most recent version of that standard (XPG7)

And so you should.  I general, we want to track the up-to-date version
of the standard.  There may be exceptions where retaining the behaviour
of an older standard is deliberate, but that is quite unusual.

So i updated the STANDARDS reference, too.

> since I don't know if the old version specified there is still
> available online.  In the past I've been able to find XPG7, XPG6,
> XPG5, and XPG2 online.  Only XPG7 and XPG6 are easy to find.

Either way, historic versions of standards are rarely needed.
We track the HISTORY of inventions, but not of standardization.

Yours,
  Ingo


CVSROOT: /cvs
Module name: src
Changes by: [hidden email] 2019/07/19 12:58:03

Modified files:
        lib/libc/time  : strptime.3

Log message:
Update POSIX reference to the 2008 version and correct the list of
conversion specifications that are extensions; issues reported by
Andras Farkas <deepbluemistake at gmail dot com> on bugs@.

While here, note that alternative conversion modifiers have no effect
and that flags and field width specifications are not supported.


Index: strptime.3
===================================================================
RCS file: /cvs/src/lib/libc/time/strptime.3,v
retrieving revision 1.29
diff -u -r1.29 strptime.3
--- strptime.3 16 May 2019 13:35:17 -0000 1.29
+++ strptime.3 19 Jul 2019 18:57:00 -0000
@@ -250,6 +250,7 @@
 .Ox
 implementation always uses the C locale and ignores the
 global locale and the thread-specific locale.
+Alternative conversion modifiers have no effect.
 .Pp
 There is no way to specify whether Daylight Saving Time is in effect when
 calling
@@ -291,16 +292,20 @@
 .Sh STANDARDS
 The
 .Fn strptime
-function conforms to
-.St -xpg4.2 .
+function conforms to the X/Open System Interfaces option of
+.St -p1003.1-2008 ,
+except that flags and field width specifications are not supported.
 .Pp
 The
-.Ql \&%G ,
+.Ql \&%F ,
 .Ql \&%g ,
+.Ql \&%G ,
+.Ql \&%k ,
+.Ql \&%l ,
 .Ql \&%s ,
 .Ql \&%u ,
 .Ql \&%V ,
-.Ql \&%Y ,
+.Ql \&%z ,
 and
 .Ql \&%Z
 conversion specifications are extensions.