This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Declare ecvt, fcvt, gcvt, mktemp in stdlib.h for XOPEN2K (bug 14824)


Bug 14824 is four failures of conform/ tests of stdlib.h for XOPEN2K,
caused by functions in stdlib.h being wrongly disabled for XOPEN2K
rather than only XOPEN2K8 (the version that actually removed these
four functions).

This patch fixes this by adjusting the conditions in the header.
Because one of the conditions in question surrounds an __USE_MISC
condition for six related functions that never were in the POSIX /
XOPEN standards, this also affects when those six functions are
declared (causing them to be declared for the __USE_XOPEN_EXTENDED &&
__USE_XOPEN2K && __USE_MISC combination), which makes at least as much
sense as the version before that didn't reflect when the corresponding
POSIX / XOPEN functions were removed.

Tested x86_64, where it reduces the number of XOPEN2K conform/
failures from 17 to 13.

2012-11-09  Joseph Myers  <joseph@codesourcery.com>

	[BZ #14824]
	* stdlib/stdlib.h [__USE_XOPEN_EXTENDED && __USE_XOPEN2K]
	(mktemp): Enable declaration.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K] (ecvt): Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K] (fcvt): Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K] (gcvt): Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (qecvt):
	Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (qfcvt):
	Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (qgcvt):
	Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (ecvt_r):
	Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (fcvt_r):
	Likewise.
	[__USE_XOPEN_EXTENDED && __USE_XOPEN2K && __USE_MISC] (gcvt_r):
	Likewise.

diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 0eb982c..fc83f4e 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -596,7 +596,7 @@ extern int clearenv (void) __THROW;
 
 
 #if defined __USE_MISC \
-    || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K)
+    || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8)
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
@@ -796,7 +796,7 @@ __END_NAMESPACE_C99
 #endif
 
 
-#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
+#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
     || defined __USE_SVID
 /* Convert floating point numbers to strings.  The returned values are
    valid only until another call to the same function.  */

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]