From: Ulrich Drepper Date: Sun, 26 Feb 2012 18:17:27 +0000 (-0500) Subject: Fix up POSIX testing in conformtest X-Git-Tag: upstream/2.30~11577 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4efeffc1d583597e4f52985b9747269e47b754e2;p=external%2Fglibc.git Fix up POSIX testing in conformtest --- diff --git a/ChangeLog b/ChangeLog index ebd4404..b522826 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2012-02-26 Ulrich Drepper + + * 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 only for waitid. + * posix/unistd.h: fsync and ftruncate were in early POSIX as well. + * rt/aio.h: Define __need_timespec before including . + * 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 * sysdeps/ieee754/dbl-64/k_tan.c: Replace with empty file. diff --git a/conform/Makefile b/conform/Makefile index 5d88732..d7d939e 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 f90a418..fd45a8d 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_]*) *([>= + + * sysdeps/pthread/pthread.h: Define __need_timespec before including + . + * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Name pthread_attr_t + union. + * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h: Likewise. + * sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h: Likewise. + 2012-02-21 Joseph Myers [BZ #13695] diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index c2eb91a..df7445e 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -21,6 +21,7 @@ #include #include #include +#define __need_timespec #include #include @@ -71,7 +72,7 @@ enum #endif -#ifdef __USE_UNIX98 +#if defined __USE_POSIX199506 || defined __USE_UNIX98 /* Mutex protocols. */ enum { diff --git a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h index 74359ff..437ef1f 100644 --- a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,7 +35,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h index b7c62f4..69bd97b 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h @@ -1,7 +1,6 @@ /* Machine-specific pthread type layouts. PowerPC version. - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Paul Mackerras , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -50,7 +49,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h index 3eb4c4a..d87a635 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h @@ -1,6 +1,5 @@ -/* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Martin Schwidefsky , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -49,7 +48,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h index 150ae74..34b0792 100644 --- a/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h @@ -1,7 +1,5 @@ -/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 - Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -39,7 +37,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h index 6b432c4..2cfaadb 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h @@ -1,7 +1,6 @@ /* Machine-specific pthread type layouts. SPARC version. - Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Jakub Jelinek , 2003. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -50,7 +49,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h index 76b0b52..7cbb200 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h @@ -1,6 +1,5 @@ -/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +/* Copyright (C) 2002-2007, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -49,7 +48,7 @@ typedef unsigned long int pthread_t; -typedef union +typedef union __pthread_attr { char __size[__SIZEOF_PTHREAD_ATTR_T]; long int __align; diff --git a/posix/sys/wait.h b/posix/sys/wait.h index f889ada..8983a8f 100644 --- a/posix/sys/wait.h +++ b/posix/sys/wait.h @@ -28,7 +28,6 @@ __BEGIN_DECLS #include -#include /* These macros could also be defined in . */ #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8) @@ -138,6 +137,7 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc); extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options); #if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8 +# include # define __need_siginfo_t # include /* Wait for a childing matching IDTYPE and ID to change the status and diff --git a/posix/unistd.h b/posix/unistd.h index ce43450..6f509e9 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -971,13 +971,11 @@ extern char *getpass (const char *__prompt) __nonnull ((1)); #endif /* Use BSD || X/Open. */ -#if defined __USE_BSD || defined __USE_XOPEN || defined __USE_XOPEN2K /* Make all changes done to FD actually appear on disk. This function is a cancellation point and therefore not marked with __THROW. */ extern int fsync (int __fd); -#endif /* Use BSD || X/Open || Unix98. */ #ifdef __USE_GNU @@ -1032,7 +1030,8 @@ extern int truncate64 (const char *__file, __off64_t __length) #endif /* Use BSD || X/Open Unix || POSIX 2008. */ -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_POSIX199309 \ + || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K /* Truncate the file FD is open on to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 @@ -1049,7 +1048,7 @@ extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length), extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur; # endif -#endif /* Use BSD || X/Open Unix || POSIX 2003. */ +#endif /* Use BSD || POSIX.1b || X/Open Unix || XPG6. */ #if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \ diff --git a/rt/aio.h b/rt/aio.h index 898a1e2..8c63159 100644 --- a/rt/aio.h +++ b/rt/aio.h @@ -25,6 +25,7 @@ #include #include #include +#define __need_timespec #include #include diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h index ecef39d..0635e2f 100644 --- a/sysdeps/unix/sysv/linux/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h @@ -1,5 +1,5 @@ /* siginfo_t, sigevent and constants. Linux version. - Copyright (C) 1997-2002, 2003, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2002, 2003, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ typedef union sigval # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) # endif -typedef struct siginfo +typedef struct { int si_signo; /* Signal number. */ int si_errno; /* If non-zero, an errno value associated with @@ -269,6 +269,9 @@ enum # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) # endif +/* Forward declaration. */ +typedef union __pthread_attr pthread_attr_t; + typedef struct sigevent { sigval_t sigev_value; @@ -286,7 +289,7 @@ typedef struct sigevent struct { void (*_function) (sigval_t); /* Function to start. */ - void *_attribute; /* Really pthread_attr_t. */ + pthread_attr_t *_attribute; /* Thread attributes. */ } _sigev_thread; } _sigev_un; } sigevent_t; diff --git a/sysdeps/unix/sysv/linux/bits/time.h b/sysdeps/unix/sysv/linux/bits/time.h index 977155c..7805ce7 100644 --- a/sysdeps/unix/sysv/linux/bits/time.h +++ b/sysdeps/unix/sysv/linux/bits/time.h @@ -1,5 +1,5 @@ /* System-dependent timing definitions. Linux version. - Copyright (C) 1996,1997,1999-2003,2010,2011 Free Software Foundation, Inc. + Copyright (C) 1996,1997,1999-2003,2010,2011,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,7 +47,8 @@ struct timeval XSI-conformant systems. */ # define CLOCKS_PER_SEC 1000000l -# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K +# if (!defined __STRICT_ANSI__ || defined __USE_POSIX) \ + && !defined __USE_XOPEN2K /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK presents the real value for clock ticks per second for the system. */ # include diff --git a/sysdeps/unix/sysv/linux/s390/bits/siginfo.h b/sysdeps/unix/sysv/linux/s390/bits/siginfo.h index 0c4bc5d..a4a07ec 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/s390/bits/siginfo.h @@ -1,5 +1,5 @@ /* siginfo_t, sigevent and constants. S/390 version. - Copyright (C) 2001, 2002, 2003, 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2009, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ typedef union sigval # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) # endif -typedef struct siginfo +typedef struct { int si_signo; /* Signal number. */ int si_errno; /* If non-zero, an errno value associated with diff --git a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h b/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h index 772e54f..3634b55 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/siginfo.h @@ -1,5 +1,5 @@ /* siginfo_t, sigevent and constants. Linux/SPARC version. - Copyright (C) 1997-2002, 2003, 2011 Free Software Foundation, Inc. + Copyright (C) 1997-2002, 2003, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ typedef union sigval # define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) # endif -typedef struct siginfo +typedef struct { int si_signo; /* Signal number. */ int si_errno; /* If non-zero, an errno value associated with