Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix limits.h NL_NMAX namespace (bug 19929).
bits/xopen_lim.h (included by limits.h if __USE_XOPEN) defines
NL_NMAX, but this constant was removed in the 2008 edition of POSIX so
should not be defined in that case.  This patch duly disables that
define for __USE_XOPEN2K8.  It remains enabled for __USE_GNU to avoid
affecting sysconf (_SC_NL_NMAX), the implementation of which uses
"#ifdef NL_NMAX".

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #19929]
	* include/bits/xopen_lim.h (NL_NMAX): Do not define if
	[__USE_XOPEN2K8 && !__USE_GNU].
	* conform/Makefile (test-xfail-XOPEN2K8/limits.h/conform): Remove
	variable.
  • Loading branch information
Joseph Myers committed Apr 8, 2016
1 parent ed80f20 commit eb64b6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,5 +1,11 @@
2016-04-08 Joseph Myers <joseph@codesourcery.com>

[BZ #19929]
* include/bits/xopen_lim.h (NL_NMAX): Do not define if
[__USE_XOPEN2K8 && !__USE_GNU].
* conform/Makefile (test-xfail-XOPEN2K8/limits.h/conform): Remove
variable.

[BZ #19925]
* sysdeps/unix/sysv/linux/alpha/bits/termios.h (XCASE): Do not
define if [!__USE_MISC && __USE_XOPEN2K].
Expand Down
1 change: 0 additions & 1 deletion conform/Makefile
Expand Up @@ -225,7 +225,6 @@ test-xfail-POSIX2008/netinet/in.h/conform = yes
test-xfail-POSIX2008/signal.h/conform = yes
test-xfail-POSIX2008/sys/socket.h/conform = yes
test-xfail-POSIX2008/sys/wait.h/conform = yes
test-xfail-XOPEN2K8/limits.h/conform = yes
test-xfail-XOPEN2K8/signal.h/conform = yes
test-xfail-XOPEN2K8/stdio.h/conform = yes
test-xfail-XOPEN2K8/sys/wait.h/conform = yes
Expand Down
4 changes: 3 additions & 1 deletion include/bits/xopen_lim.h
Expand Up @@ -77,7 +77,9 @@

/* Maximum number of bytes in N-to-1 collation mapping. We have no
limit. */
#define NL_NMAX INT_MAX
#if defined __USE_GNU || !defined __USE_XOPEN2K8
# define NL_NMAX INT_MAX
#endif

/* Maximum set number. We have no limit. */
#define NL_SETMAX INT_MAX
Expand Down

0 comments on commit eb64b6d

Please sign in to comment.