From 4efeffc1d583597e4f52985b9747269e47b754e2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Feb 2012 13:17:27 -0500 Subject: Fix up POSIX testing in conformtest --- conform/conformtest.pl | 68 ++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 36 deletions(-) (limited to 'conform/conformtest.pl') diff --git a/conform/conformtest.pl b/conform/conformtest.pl index f90a4182b3..fd45a8d2ee 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -32,27 +32,10 @@ if (@headers == ()) { "arpa/inet.h", "aio.h"); } -if ($standard ne "ISO" && $standard ne "ISO99" && $standard ne "ISO11" - && $standard ne "POSIX" && $standard ne "XPG3" && $standard ne "XPG4" - && $standard ne "UNIX98" && $standard ne "XOPEN2K" && $standard ne "XOPEN2K8" - && $standard ne "POSIX2008") { - die "unknown standard \"$standard\""; -} - -# These are the ISO C99 keywords. -@keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default', - 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', - 'if', 'inline', 'int', 'long', 'register', 'restrict', 'return', - 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', - 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while'); - -# These are symbols which are known to pollute the namespace. -@knownproblems = ('unix', 'linux', 'i386'); - $CFLAGS{"ISO"} = "-ansi"; $CFLAGS{"ISO99"} = "-std=c99"; $CFLAGS{"ISO11"} = "-std=c1x -D_ISOC11_SOURCE"; -$CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199912"; +$CFLAGS{"POSIX"} = "-D_POSIX_C_SOURCE=199912 -ansi"; $CFLAGS{"XPG3"} = "-D_XOPEN_SOURCE"; $CFLAGS{"XPG4"} = "-D_XOPEN_SOURCE_EXTENDED"; $CFLAGS{"UNIX98"} = "-D_XOPEN_SOURCE=500"; @@ -62,27 +45,40 @@ $CFLAGS{"POSIX2008"} = "-D_POSIX_C_SOURCE=200809L"; $CFLAGS = "$flags -fno-builtin '-D__attribute__(x)=' $CFLAGS{$standard} -D_ISOMAC"; -if ($standard ne "XOPEN2K8" && $standard ne "POSIX2008") { - # Some headers need a bit more attention. At least with XPG7 - # all headers should be self-contained. - $mustprepend{'inttypes.h'} = "#include \n"; - $mustprepend{'glob.h'} = "#include \n"; - $mustprepend{'grp.h'} = "#include \n"; - $mustprepend{'regex.h'} = "#include \n"; - $mustprepend{'pwd.h'} = "#include \n"; - $mustprepend{'sched.h'} = "#include \n"; - $mustprepend{'signal.h'} = "#include \n#include \n"; - $mustprepend{'stdio.h'} = "#include \n"; - $mustprepend{'sys/stat.h'} = "#include \n"; - $mustprepend{'wchar.h'} = "#include \n"; - $mustprepend{'wordexp.h'} = "#include \n"; -} +# Check standard name for validity. +die "unknown standard \"$standard\"" if ($CFLAGS{$standard} eq ""); + +# if ($standard ne "XOPEN2K8" && $standard ne "POSIX2008") { +# # Some headers need a bit more attention. At least with XPG7 +# # all headers should be self-contained. +# $mustprepend{'inttypes.h'} = "#include \n"; +# $mustprepend{'glob.h'} = "#include \n"; +# $mustprepend{'grp.h'} = "#include \n"; +# $mustprepend{'regex.h'} = "#include \n"; +# $mustprepend{'pwd.h'} = "#include \n"; +# $mustprepend{'sched.h'} = "#include \n"; +# $mustprepend{'signal.h'} = "#include \n#include \n"; +# $mustprepend{'stdio.h'} = "#include \n"; +# $mustprepend{'sys/stat.h'} = "#include \n"; +# $mustprepend{'wchar.h'} = "#include \n"; +# $mustprepend{'wordexp.h'} = "#include \n"; +# } + +# These are the ISO C99 keywords. +@keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default', + 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', + 'if', 'inline', 'int', 'long', 'register', 'restrict', 'return', + 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', + 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while'); # Make a hash table from this information. 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; @@ -436,7 +432,7 @@ while ($#headers >= 0) { "Member \"$member\" does not have the correct type.", $res, 0); } - } elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>=<]+) ([A-Za-z0-9_-]*)/) { + } elsif (/^optional-constant *([a-zA-Z0-9_]*) ([>== 0) { $res = runtest ($fnamebase, "Testing for value of constant $const", "Constant \"$const\" has not the right value.", $res); } - } elsif (/^constant *([a-zA-Z0-9_]*) *([>=<]+) ([A-Za-z0-9_-]*)/) { + } elsif (/^constant *([a-zA-Z0-9_]*) *([>== 0) { compiletest ($fnamebase, "Test availability of macro $macro", "NOT PRESENT", $missing, 1); - } elsif (/^macro *([a-zA-Z0-9_]*) *([>=<]+) ([A-Za-z0-9_]*)/) { + } elsif (/^macro *([a-zA-Z0-9_]*) *([>=