I suspect that changing this behavior would be a disruptive
backwards-incompatible change (but other opinions are welcomed).

I wouldn't mind a change as long as it changes the API enough so that compilers complain if we don't also update the calling code. For example, nstrftime could take an additional ptrdiff_t * argument that (if not null) is set to the offset of the first offending % or encoding error, or to -1 if the format is OK. (We should report encoding errors as well as bad % formats.)

(Using ptrdiff_t is part of my campaign to prefer ptrdiff_t to size_t. While we're at it, let's change the other size_t args to ptrdiff_t, but I digress....)

nstrtime's __strftime_internal() is a complicated beast, I don't
claim to fully understand it.
But the function contains this comment:
    /* POSIX.1 requires that local time zone information be used as
      though strftime called tzset.  */

This comment is for the POSIX API where there was no timezone_t argument. It doesn't apply to the Gnulib API, because of the "undef HAVE_TZSET" earlier on. The only reason for the tzset_called stuff is the faint hope that we can merge all this stuff into glibc someday.

Reply via email to