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]

conformtest: Always pass C standards options to compiler


For some of the standards it tests, conformtest passes appropriate C
standards conformance options such as -ansi or -std=c99 to the
compiler.  For others, it does not pass those options.

The standards such as POSIX generally define what happens, given a
compiler for the appropriate C standard version, when appropriate
feature test macros are also defined; the starting point for those
standards is a compiler following the relevant C standard, and then
you define a macro in the implementation namespace to make other
definitions visible.  (Some older standards also define bindings to
some form of traditional C.)  So it's appropriate for all the
standards testing in conformtest to pass appropriate compiler options
for C standards conformance; this also fixes a number of failures
where the tests are testing something about a header provided by GCC,
and those headers purely use the standards mode to determine what to
define, without regard to glibc's macros such as __USE_ISOC99.  This
also avoids the need for @knownproblems listing the macros predefined
(for one particular architecture) by GCC outside of conformance mode.

I propose this patch to use such options as discussed above.  Tested
x86_64.

2012-04-28  Joseph Myers  <joseph@codesourcery.com>

	* conform/conformtest.pl: Use -ansi for XPG3, XPG4 and UNIX98.
	Use -std=c99 for XOPEN2K.
	(@knownproblems): Remove.
	(newtoken): Don't check %isknown.

diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index 25e05a2..f793347 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -36,10 +36,10 @@ $CFLAGS{"ISO"} = "-ansi";
 $CFLAGS{"ISO99"} = "-std=c99";
 $CFLAGS{"ISO11"} = "-std=c1x -D_ISOC11_SOURCE";
 $CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199912 -ansi";
-$CFLAGS{"XPG3"} = "-D_XOPEN_SOURCE";
-$CFLAGS{"XPG4"} = "-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED";
-$CFLAGS{"UNIX98"} = "-D_XOPEN_SOURCE=500";
-$CFLAGS{"XOPEN2K"} = "-D_XOPEN_SOURCE=600";
+$CFLAGS{"XPG3"} = "-ansi -D_XOPEN_SOURCE";
+$CFLAGS{"XPG4"} = "-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED";
+$CFLAGS{"UNIX98"} = "-ansi -D_XOPEN_SOURCE=500";
+$CFLAGS{"XOPEN2K"} = "-std=c99 -D_XOPEN_SOURCE=600";
 $CFLAGS{"XOPEN2K8"} = "-std=c99 -D_XOPEN_SOURCE=700";
 $CFLAGS{"POSIX2008"} = "-std=c99 -D_POSIX_C_SOURCE=200809L";
 
@@ -76,14 +76,6 @@ while ($#keywords >= 0) {
   $iskeyword{pop (@keywords)} = 1;
 }
 
-# These are symbols which are known to pollute the namespace.
-@knownproblems = ('unix', 'linux', 'i386');
-
-# Make a hash table from the known problems.
-while ($#knownproblems >= 0) {
-  $isknown{pop (@knownproblems)} = 1;
-}
-
 $verbose = 1;
 
 $total = 0;
@@ -240,10 +232,6 @@ sub newtoken {
   for ($idx = 0; $idx <= $#allow; ++$idx) {
     return if (poorfnmatch ($allow[$idx], $token));
   }
-
-  unless ($isknown{$token}) {
-    $errors{$token} = 1;
-  }
 }
 
 

-- 
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]