aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2012-02-26 13:17:27 -0500
committerUlrich Drepper <drepper@gmail.com>2012-02-26 13:17:27 -0500
commit4efeffc1d583597e4f52985b9747269e47b754e2 (patch)
tree65bb598457542a0de30c60646173679c5ea42557
parentc20105c398036c4fbeb99f8480ab84077a0f6f2c (diff)
downloadglibc-4efeffc1d583597e4f52985b9747269e47b754e2.tar.xz
glibc-4efeffc1d583597e4f52985b9747269e47b754e2.zip
Fix up POSIX testing in conformtest
-rw-r--r--ChangeLog36
-rw-r--r--conform/Makefile2
-rw-r--r--conform/conformtest.pl68
-rw-r--r--conform/data/aio.h-data4
-rw-r--r--conform/data/fcntl.h-data11
-rw-r--r--conform/data/glob.h-data4
-rw-r--r--conform/data/grp.h-data4
-rw-r--r--conform/data/pthread.h-data10
-rw-r--r--conform/data/pwd.h-data5
-rw-r--r--conform/data/signal.h-data7
-rw-r--r--conform/data/spawn.h-data2
-rw-r--r--conform/data/stdio.h-data18
-rw-r--r--conform/data/stdlib.h-data2
-rw-r--r--conform/data/stropts.h-data2
-rw-r--r--conform/data/sys/mman.h-data4
-rw-r--r--conform/data/sys/stat.h-data38
-rw-r--r--conform/data/sys/types.h-data8
-rw-r--r--conform/data/sys/wait.h-data13
-rw-r--r--conform/data/time.h-data6
-rw-r--r--conform/data/unistd.h-data23
-rw-r--r--conform/data/utime.h-data4
-rw-r--r--io/sys/stat.h2
-rw-r--r--nptl/ChangeLog12
-rw-r--r--nptl/sysdeps/pthread/pthread.h3
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h5
-rw-r--r--posix/sys/wait.h2
-rw-r--r--posix/unistd.h7
-rw-r--r--rt/aio.h1
-rw-r--r--sysdeps/unix/sysv/linux/bits/siginfo.h9
-rw-r--r--sysdeps/unix/sysv/linux/bits/time.h5
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/siginfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/siginfo.h4
37 files changed, 240 insertions, 110 deletions
diff --git a/ChangeLog b/ChangeLog
index ebd440481a..b522826001 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2012-02-26 Ulrich Drepper <drepper@gmail.com>
+
+ * conform/Makefile: For now ignore errors from run-conformtest.
+ * conform/conformtest.pl: Simplify code. Add -ansi to CFLAGS for
+ POSIX to avoid namespace pollution. Don't prepend headers.
+ * conform/data/aio.h-data: Fixes for POSIX testing.
+ * conform/data/fcntl.h-data: Likewise.
+ * conform/data/glob.h-data: Likewise.
+ * conform/data/grp.h-data: Likewise.
+ * conform/data/pthread.h-data: Likewise.
+ * conform/data/pwd.h-data: Likewise.
+ * conform/data/signal.h-data: Likewise.
+ * conform/data/spawn.h-data: Likewise.
+ * conform/data/stdio.h-data: Likewise.
+ * conform/data/stdlib.h-data: Likewise.
+ * conform/data/stropts.h-data: Likewise.
+ * conform/data/sys/mman.h-data: Likewise.
+ * conform/data/sys/stat.h-data: Likewise.
+ * conform/data/sys/types.h-data: Likewise.
+ * conform/data/sys/wait.h-data: Likewise.
+ * conform/data/time.h-data: Likewise.
+ * conform/data/unistd.h-data: Likewise.
+ * conform/data/utime.h-data: Likewise.
+
+ * io/sys/stat.h: fchmod was always in POSIX.
+ * posix/sys/wait.h: Include <sys/resource.h> only for waitid.
+ * posix/unistd.h: fsync and ftruncate were in early POSIX as well.
+ * rt/aio.h: Define __need_timespec before including <time.h>.
+ * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
+ struct. Add forward declaration of pthread_attr_t and use it in
+ sigevent.
+ * sysdeps/unix/sysv/linux/s390/bits/siginfo.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/siginfo.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/time.h: Don't let __STRICT_ANSI__
+ always remove CLK_TCK definition.
+
2012-02-26 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/ieee754/dbl-64/k_tan.c: Replace with empty file.
diff --git a/conform/Makefile b/conform/Makefile
index 5d88732e30..d7d939ea61 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -30,7 +30,7 @@ tests: $(objpfx)run-conformtest.out
$(objpfx)run-conformtest.out: run-conformtest.sh conformtest.pl \
$(wildcard data/*.h-data) \
$(wildcard data/*/*.h-data)
- $(SHELL) -e $< $(objpfx) $(PERL) '$(CC)' \
+ -$(SHELL) -e $< $(objpfx) $(PERL) '$(CC)' \
'-I../include $(+sysdep-includes) $(sysincludes) -I..'
generated = $(wildcard $(objpfx)conform-*.out)
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 <stddef.h>\n";
- $mustprepend{'glob.h'} = "#include <sys/types.h>\n";
- $mustprepend{'grp.h'} = "#include <sys/types.h>\n";
- $mustprepend{'regex.h'} = "#include <sys/types.h>\n";
- $mustprepend{'pwd.h'} = "#include <sys/types.h>\n";
- $mustprepend{'sched.h'} = "#include <sys/types.h>\n";
- $mustprepend{'signal.h'} = "#include <pthread.h>\n#include <sys/types.h>\n";
- $mustprepend{'stdio.h'} = "#include <sys/types.h>\n";
- $mustprepend{'sys/stat.h'} = "#include <sys/types.h>\n";
- $mustprepend{'wchar.h'} = "#include <stdarg.h>\n";
- $mustprepend{'wordexp.h'} = "#include <stddef.h>\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 <stddef.h>\n";
+# $mustprepend{'glob.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'grp.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'regex.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'pwd.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'sched.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'signal.h'} = "#include <pthread.h>\n#include <sys/types.h>\n";
+# $mustprepend{'stdio.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'sys/stat.h'} = "#include <sys/types.h>\n";
+# $mustprepend{'wchar.h'} = "#include <stdarg.h>\n";
+# $mustprepend{'wordexp.h'} = "#include <stddef.h>\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_]*) ([>=<!]+) ([A-Za-z0-9_-]*)/) {
my($const) = $1;
my($op) = $2;
my($value) = $3;
@@ -467,7 +463,7 @@ while ($#headers >= 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_]*) *([>=<!]+) ([A-Za-z0-9_-]*)/) {
my($const) = $1;
my($op) = $2;
my($value) = $3;
@@ -987,7 +983,7 @@ while ($#headers >= 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_]*) *([>=<!]+) ([A-Za-z0-9_]*)/) {
my($macro) = "$1";
my($op) = $2;
my($value) = $3;
diff --git a/conform/data/aio.h-data b/conform/data/aio.h-data
index b810014b3f..d6d0acbbe6 100644
--- a/conform/data/aio.h-data
+++ b/conform/data/aio.h-data
@@ -28,12 +28,12 @@ function int aio_suspend (const struct aiocb* const[], int, const struct timespe
function int aio_write (struct aiocb*)
function int lio_listio (int, struct aiocb *const[], int, struct sigevent*)
-# if !defined POSIX
+// POSIX in theory doesn't allow the header to be self contained but
+// this was fixed later and we do not test for this here.
allow-header fcntl.h
allow-header signal.h
allow-header sys/types.h
allow-header time.h
-# endif
allow aio_*
allow lio_*
diff --git a/conform/data/fcntl.h-data b/conform/data/fcntl.h-data
index 54eed417e7..46892488b1 100644
--- a/conform/data/fcntl.h-data
+++ b/conform/data/fcntl.h-data
@@ -1,4 +1,4 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
+#if !defined ISO && !defined ISO99 && !defined ISO11
constant F_DUPFD
constant F_GETFD
constant F_SETFD
@@ -7,8 +7,10 @@ constant F_SETFL
constant F_GETLK
constant F_SETLK
constant F_SETLKW
+#if !defined POSIX && !defined XPG3 && !defined XPG4 && !defined UNIX98
constant F_GETOWN
constant F_SETOWN
+#endif
constant FD_CLOEXEC
@@ -16,9 +18,11 @@ constant F_RDLCK
constant F_UNLCK
constant F_WRLCK
+#if !defined POSIX
constant SEEK_SET
constant SEEK_CUR
constant SEEK_END
+#endif
constant O_CREAT
constant O_EXCL
@@ -37,6 +41,7 @@ constant O_RDONLY
constant O_RDWR
constant O_WRONLY
+#if !defined POSIX
constant S_IFMT
constant S_IFBLK
constant S_IFCHR
@@ -60,9 +65,10 @@ constant S_IWOTH
constant S_IXOTH
constant S_ISUID
constant S_ISGID
-#if !defined POSIX && !defined POSIX2008
+#if !defined POSIX2008
constant S_ISVTX
#endif
+#endif
#if defined XOPEN2K || defined XOPEN2K8 || defined POSIX2008
constant POSIX_FADV_NORMAL
@@ -103,7 +109,6 @@ constant O_EXEC
constant O_SEARCH
constant O_DIRECTORY
constant O_NOFOLLOW
-constant FD_CLOEXEC
constant F_DUPFD_CLOEXEC
constant AT_FDCWD
constant AT_EACCESS
diff --git a/conform/data/glob.h-data b/conform/data/glob.h-data
index 23a5077950..fc2c7febf6 100644
--- a/conform/data/glob.h-data
+++ b/conform/data/glob.h-data
@@ -1,4 +1,8 @@
#if !defined ISO && !defined ISO99 && !defined ISO11
+#ifdef POSIX
+# define size_t __size_t
+#endif
+
type glob_t
element glob_t size_t gl_pathc
element glob_t {char**} gl_pathv
diff --git a/conform/data/grp.h-data b/conform/data/grp.h-data
index 384e1ad5ba..1edba738bb 100644
--- a/conform/data/grp.h-data
+++ b/conform/data/grp.h-data
@@ -1,4 +1,8 @@
#if !defined ISO && !defined ISO99 && !defined ISO11
+#ifdef POSIX
+# define gid_t __gid_t
+#endif
+
type {struct group}
element {struct group} {char*} gr_name
element {struct group} gid_t gr_gid
diff --git a/conform/data/pthread.h-data b/conform/data/pthread.h-data
index bf25902127..4af4d05b5b 100644
--- a/conform/data/pthread.h-data
+++ b/conform/data/pthread.h-data
@@ -48,10 +48,6 @@ type pthread_spinlock_t
# endif
type pthread_t
-#ifdef POSIX
-# define sigset_t __sigset_t
-#endif
-
function int pthread_attr_destroy (pthread_attr_t*)
function int pthread_attr_getdetachstate (const pthread_attr_t*, int*)
# ifndef POSIX
@@ -95,10 +91,14 @@ function int pthread_cond_signal (pthread_cond_t*)
function int pthread_cond_timedwait (pthread_cond_t*, pthread_mutex_t*, const struct timespec*)
function int pthread_cond_wait (pthread_cond_t*, pthread_mutex_t*)
function int pthread_condattr_destroy (pthread_condattr_t*)
+#if !defined POSIX && !defined UNIX98 && !defined XOPEN2K
optional-function int pthread_condattr_getclock (const pthread_condattr_t*, clockid_t*)
+#endif
function int pthread_condattr_getpshared (const pthread_condattr_t*, int*)
function int pthread_condattr_init (pthread_condattr_t*)
+#if !defined POSIX && !defined UNIX98 && !defined XOPEN2K
optional-function int pthread_condattr_setclock (pthread_condattr_t*, clockid_t)
+#endif
function int pthread_condattr_setpshared (pthread_condattr_t*, int)
function int pthread_create (pthread_t*, const pthread_attr_t*, void *(*) (void*), void*)
function int pthread_detach (pthread_t)
@@ -162,7 +162,7 @@ function int pthread_setconcurrency (int)
# endif
function int pthread_setschedparam (pthread_t, int, const struct sched_param*)
function int pthread_setspecific (pthread_key_t, const void*)
-# if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
+# if !defined POSIX && !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
function int pthread_sigmask (int, const sigset_t*, sigset_t*)
# endif
# if !defined POSIX
diff --git a/conform/data/pwd.h-data b/conform/data/pwd.h-data
index f779a697b3..64d617fdcf 100644
--- a/conform/data/pwd.h-data
+++ b/conform/data/pwd.h-data
@@ -1,4 +1,9 @@
#if !defined ISO && !defined ISO99 && !defined ISO11
+#ifdef POSIX
+# define uid_t __uid_t
+# define gid_t __gid_t
+#endif
+
type {struct passwd}
element {struct passwd} {char*} pw_name
element {struct passwd} uid_t pw_uid
diff --git a/conform/data/signal.h-data b/conform/data/signal.h-data
index 927211b28a..18f1b9e096 100644
--- a/conform/data/signal.h-data
+++ b/conform/data/signal.h-data
@@ -8,7 +8,12 @@ typed-constant SIG_IGN {void(*)(int)}
type sig_atomic_t
#if !defined ISO && !defined ISO99 && !defined ISO11
type sigset_t
+#endif
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
type pid_t
+#elif defined POSIX
+# define pid_t __pid_t
+# define uid_t __uid_t
#endif
#if defined XOPEN2K8 || defined POSIX2008
type size_t
@@ -28,7 +33,7 @@ element {struct timespec} __time_t tv_sec
element {struct timespec} long tv_nsec
#endif
-#if defined UNIX98 || defined XOPEN2K8 || defined POSIX2008
+#if defined POSIX || defined UNIX98 || defined XOPEN2K8 || defined POSIX2008
element {union sigval} int sival_int
element {union sigval} {void*} sival_ptr
diff --git a/conform/data/spawn.h-data b/conform/data/spawn.h-data
index 889b5bc7db..637f2bf0d0 100644
--- a/conform/data/spawn.h-data
+++ b/conform/data/spawn.h-data
@@ -1,4 +1,4 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11
+#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX
type posix_spawnattr_t
type posix_spawn_file_actions_t
# if defined XOPEN2K8 || defined POSIX2008
diff --git a/conform/data/stdio.h-data b/conform/data/stdio.h-data
index ac2dfc4215..abd3a8e8c1 100644
--- a/conform/data/stdio.h-data
+++ b/