From 6736a8833373cc6302e57c4b4ae6ff05a15a27a6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 30 Apr 2017 11:38:25 +0200 Subject: [PATCH] Document the problem with the Cygwin environment variable TZ. * doc/posix-functions/tzset.texi: Add note about TZ. * doc/posix-functions/ctime.texi: Likewise. * doc/posix-functions/localtime.texi: Likewise. * doc/posix-functions/mktime.texi: Likewise. * doc/posix-functions/strftime.texi: Likewise. * doc/posix-functions/wcsftime.texi: Likewise. * doc/pastposix-functions/ftime.texi: Likewise. --- ChangeLog | 11 +++++++++++ doc/pastposix-functions/ftime.texi | 3 +++ doc/posix-functions/ctime.texi | 3 +++ doc/posix-functions/localtime.texi | 6 +++++- doc/posix-functions/mktime.texi | 3 +++ doc/posix-functions/strftime.texi | 3 +++ doc/posix-functions/tzset.texi | 3 +++ doc/posix-functions/wcsftime.texi | 3 +++ 8 files changed, 34 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e7e29956cd..818d6e2422 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2017-04-30 Bruno Haible + + Document the problem with the Cygwin environment variable TZ. + * doc/posix-functions/tzset.texi: Add note about TZ. + * doc/posix-functions/ctime.texi: Likewise. + * doc/posix-functions/localtime.texi: Likewise. + * doc/posix-functions/mktime.texi: Likewise. + * doc/posix-functions/strftime.texi: Likewise. + * doc/posix-functions/wcsftime.texi: Likewise. + * doc/pastposix-functions/ftime.texi: Likewise. + 2017-04-30 Bruno Haible utime-tests: New module. diff --git a/doc/pastposix-functions/ftime.texi b/doc/pastposix-functions/ftime.texi index 0fcaed1ecc..582a088163 100644 --- a/doc/pastposix-functions/ftime.texi +++ b/doc/pastposix-functions/ftime.texi @@ -16,6 +16,9 @@ Portability problems not fixed by Gnulib: This function is missing on some platforms: Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, IRIX 5.3, Solaris 2.4. @item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. +@item This function is marked as ``legacy'' in POSIX. Better use @code{gettimeofday} or @code{clock_gettime} instead, and use @code{ftime} only as a fallback for portability to Windows platforms. diff --git a/doc/posix-functions/ctime.texi b/doc/posix-functions/ctime.texi index f5a7c27626..e54a7b5b8e 100644 --- a/doc/posix-functions/ctime.texi +++ b/doc/posix-functions/ctime.texi @@ -13,6 +13,9 @@ Portability problems fixed by Gnulib: Portability problems not fixed by Gnulib: @itemize @item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. +@item This function may overflow its internal buffer if an invalid year is passed. @item The @code{ctime} function need not be reentrant, and consequently is diff --git a/doc/posix-functions/localtime.texi b/doc/posix-functions/localtime.texi index 49a6dddc0f..1d6acdba8f 100644 --- a/doc/posix-functions/localtime.texi +++ b/doc/posix-functions/localtime.texi @@ -12,7 +12,11 @@ Portability problems fixed by Gnulib: Portability problems not fixed by Gnulib: @itemize -@item On some platforms, this function returns nonsense values for +@item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. +@item +On some platforms, this function returns nonsense values for unsupported arguments (like @math{2^56}), rather than failing: FreeBSD 10. @end itemize diff --git a/doc/posix-functions/mktime.texi b/doc/posix-functions/mktime.texi index 97569480ce..ffb7b79e11 100644 --- a/doc/posix-functions/mktime.texi +++ b/doc/posix-functions/mktime.texi @@ -16,4 +16,7 @@ Portability problems fixed by Gnulib: Portability problems not fixed by Gnulib: @itemize +@item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. @end itemize diff --git a/doc/posix-functions/strftime.texi b/doc/posix-functions/strftime.texi index e58e1ef494..d371818e2e 100644 --- a/doc/posix-functions/strftime.texi +++ b/doc/posix-functions/strftime.texi @@ -13,6 +13,9 @@ Portability problems fixed by Gnulib: Portability problems not fixed by Gnulib: @itemize @item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. +@item The Windows C runtime library (which is used by MinGW) does not support the %e specifier (and possibly the other more recent SUS specifiers too, i.e., %C, %D, %h, %n, %r, %R, %t, and %T). diff --git a/doc/posix-functions/tzset.texi b/doc/posix-functions/tzset.texi index 35fc509d76..30b147cc3c 100644 --- a/doc/posix-functions/tzset.texi +++ b/doc/posix-functions/tzset.texi @@ -16,4 +16,7 @@ Solaris 2.6. Portability problems not fixed by Gnulib: @itemize +@item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. @end itemize diff --git a/doc/posix-functions/wcsftime.texi b/doc/posix-functions/wcsftime.texi index 0faa2118cf..8ab82c20a1 100644 --- a/doc/posix-functions/wcsftime.texi +++ b/doc/posix-functions/wcsftime.texi @@ -16,6 +16,9 @@ Portability problems not fixed by Gnulib: This function is missing on some platforms: OpenBSD 3.8, Minix 3.1.8, IRIX 5.3, Solaris 2.5.1, Cygwin 1.5.x, BeOS. @item +On native Windows platforms (mingw, MSVC), this function works incorrectly +when the environment variable @code{TZ} has been set by Cygwin. +@item On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot accommodate all Unicode characters. @end itemize -- 2.39.5