[tz] [PROPOSED 2/2] strftime: conform better to POSIX+

Robert Elz kre at munnari.OZ.AU
Sat Aug 8 22:01:49 UTC 2020


    Date:        Sat, 8 Aug 2020 22:25:47 +0100
    From:        "Clive D.W. Feather" <clive at davros.org>
    Message-ID:  <20200808212547.GK1036 at davros.org>

  | C has no requirement to leave errno unchanged on success.

Yes, I know, but functions can be defined to work that way.

It turns out not to matter here really, as it is trivial to arrange that
a successful call always returns >= 1, leaving 0 to always mean that
an error occurred (after which errno can be checked).

  | strftime is not documented as using errno, so that wording applies.

It is going to be specified to use errno in the next POSIX update.

This is already in the draft:

ERRORS
CX	 These functions shall fail if:

	[EOVERFLOW] The format string includes a %s conversion and the
	   number of seconds since the Epoch cannot be represented in a time_t.

These functions may fail if:

	[EINVAL]  The format string includes a %s conversion and the number
	   of seconds since the Epoch would be negative.

kre




More information about the tz mailing list