This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix _POSIX_TZNAME_MAX for older POSIX (bug 14856)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Mon, 19 Nov 2012 23:00:58 +0000
- Subject: Fix _POSIX_TZNAME_MAX for older POSIX (bug 14856)
As noted in bug 14856, _POSIX_TZNAME_MAX should be 3 not 6 for older
standards, similarly to how other such macros have their values
conditioned on the selected standard version. This patch fixes this
issue in the obvious way.
Tested x86_64, where it restores the conform/ results for POSIX (1996)
to a clean state again (there may, of course, still be further header
bugs for that standard version where the conform/ tests don't properly
describe the contents of headers I haven't yet reviewed the
expectations for).
2012-11-19 Joseph Myers <joseph@codesourcery.com>
[BZ #14856]
* posix/bits/posix1_lim.h [!__USE_XOPEN2K] (_POSIX_TZNAME_MAX):
Define to 3.
diff --git a/posix/bits/posix1_lim.h b/posix/bits/posix1_lim.h
index 5800ef5..e7587ed 100644
--- a/posix/bits/posix1_lim.h
+++ b/posix/bits/posix1_lim.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,96,98,2000-2003,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -134,7 +134,11 @@
#define _POSIX_TTY_NAME_MAX 9
/* Maximum length of a timezone name (element of `tzname'). */
-#define _POSIX_TZNAME_MAX 6
+#ifdef __USE_XOPEN2K
+# define _POSIX_TZNAME_MAX 6
+#else
+# define _POSIX_TZNAME_MAX 3
+#endif
#if !defined __USE_XOPEN2K || defined __USE_GNU
/* Maximum number of connections that can be queued on a socket. */
--
Joseph S. Myers
joseph@codesourcery.com