]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Compile with -Wundef.
authorRoland McGrath <roland@hack.frob.com>
Fri, 14 Mar 2014 17:44:34 +0000 (10:44 -0700)
committerRoland McGrath <roland@hack.frob.com>
Fri, 14 Mar 2014 18:32:51 +0000 (11:32 -0700)
21 files changed:
ChangeLog
Makeconfig
include/errno.h
include/stackinfo.h [new file with mode: 0644]
nptl/sysdeps/i386/tls.h
nptl/sysdeps/powerpc/tls.h
nptl/sysdeps/s390/tls.h
nptl/sysdeps/sh/tls.h
nptl/sysdeps/sparc/tls.h
nptl/sysdeps/x86_64/tls.h
ports/ChangeLog.hppa
ports/sysdeps/hppa/nptl/tls.h
sysdeps/aarch64/nptl/tls.h
sysdeps/alpha/nptl/tls.h
sysdeps/arm/nptl/tls.h
sysdeps/ia64/nptl/tls.h
sysdeps/m68k/nptl/tls.h
sysdeps/mach/hurd/i386/tls.h
sysdeps/microblaze/nptl/tls.h
sysdeps/mips/nptl/tls.h
sysdeps/tile/nptl/tls.h

index 6d851557f91625f62eda24365a55165248032a84..4357cb741d5bbd52ef632e26f31b3738be1cacbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2014-03-14  Roland McGrath  <roland@hack.frob.com>
+
+       * Makeconfig (+gccwarn): Add -Wundef.
+       * include/errno.h [IS_IN_rtld] [!RTLD_PRIVATE_ERRNO]: #error to catch
+       a dl-sysdep.h breaking its contract.
+       [!IS_IN_rtld] (RTLD_PRIVATE_ERRNO): Define it to 0.
+       * include/stackinfo.h: New file.
+       * nptl/sysdeps/i386/tls.h (TLS_DTV_AT_TP): New macro.
+       * nptl/sysdeps/powerpc/tls.h (TLS_TCB_AT_TP): New macro.
+       * nptl/sysdeps/s390/tls.h (TLS_DTV_AT_TP): New macro.
+       * nptl/sysdeps/sh/tls.h (TLS_TCB_AT_TP): New macro.
+       * nptl/sysdeps/sparc/tls.h (TLS_DTV_AT_TP): New macro.
+       * nptl/sysdeps/x86_64/tls.h (TLS_DTV_AT_TP): New macro.
+       * sysdeps/aarch64/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/alpha/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/arm/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/ia64/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/m68k/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/mach/hurd/i386/tls.h (TLS_DTV_AT_TP): New macro.
+       * sysdeps/microblaze/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/mips/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+       * sysdeps/tile/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+
 2014-03-14  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        [BZ #16707]
index 9078b293067d83340f8d5ea4f491b12279d07c51..fa9fb63851b7304e26a4000010372537eaf4f087 100644 (file)
@@ -685,6 +685,7 @@ ifeq ($(all-warnings),yes)
 else
 +gccwarn := -Wall -Wwrite-strings -Winline
 endif
++gccwarn += -Wundef
 +gccwarn-c = -Wstrict-prototypes
 
 # We do not depend on the address of constants in different files to be
index f1b93a881b1dd77d207253b957de3b91724541b6..dbf2a61e0d4d5d0579f54c8ec4ca0ce7ab4c44cd 100644 (file)
@@ -6,6 +6,11 @@
 
 # ifdef IS_IN_rtld
 #  include <dl-sysdep.h>
+#  ifndef RTLD_PRIVATE_ERRNO
+#   error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
+#  endif
+# else
+#  define RTLD_PRIVATE_ERRNO   0
 # endif
 
 # if RTLD_PRIVATE_ERRNO
diff --git a/include/stackinfo.h b/include/stackinfo.h
new file mode 100644 (file)
index 0000000..b9b2278
--- /dev/null
@@ -0,0 +1,42 @@
+/* Details about the machine's stack: wrapper header.
+   Copyright (C) 2014 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _INCLUDE_STACKINFO_H
+#define _INCLUDE_STACKINFO_H   1
+
+/* A sysdeps/.../stackinfo.h file defines details for the CPU.
+   It is obliged to define either _STACK_GROWS_DOWN or _STACK_GROWS_UP.  */
+#include_next <stackinfo.h>
+
+#if defined _STACK_GROWS_DOWN && _STACK_GROWS_DOWN
+# ifdef _STACK_GROWS_UP
+#  error "stackinfo.h should not define both!"
+# else
+#  define _STACK_GROWS_UP      0
+# endif
+#elif defined _STACK_GROWS_UP && _STACK_GROWS_UP
+# ifdef _STACK_GROWS_DOWN
+#  error "stackinfo.h should not define both!"
+# else
+#  define _STACK_GROWS_DOWN    0
+# endif
+#else
+# error "stackinfo.h must define _STACK_GROWS_UP or _STACK_GROWS_DOWN!"
+#endif
+
+#endif  /* include/stackinfo.h */
index 9c695c0a14649357ff8517910a344cee824d0039..4183ee82b847fe3c60012c8cbb29151d95e9bb31 100644 (file)
@@ -104,9 +104,6 @@ union user_desc_init
 };
 
 
-/* Get the thread descriptor definition.  */
-# include <nptl/descr.h>
-
 /* This is the size of the initial TCB.  Can't be just sizeof (tcbhead_t),
    because NPTL getpid, __libc_alloca_cutoff etc. need (almost) the whole
    struct pthread even when not linked with -lpthread.  */
@@ -124,6 +121,10 @@ union user_desc_init
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 # define TLS_TCB_AT_TP 1
+# define TLS_DTV_AT_TP 0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
 
 
 /* Install the dtv pointer.  The pointer passed is to the element with
index c9baf4d4690973d411f4484c288ad8bb50fa8171..556c8d59a5fe62131a82a14222216cd3b46072a4 100644 (file)
@@ -49,6 +49,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* We use the multiple_threads field in the pthread struct */
 #define TLS_MULTIPLE_THREADS_IN_TCB    1
@@ -56,6 +57,7 @@ typedef union dtv
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
 
+
 /* The stack_guard is accessed directly by GCC -fstack-protector code,
    so it is a part of public ABI.  The dtv and pointer_guard fields
    are private.  */
index d81019e4d3aee4265e23439c9bf6f785ee1af1f2..2019882f2c474a6fc94260244567b2f8384e5689 100644 (file)
@@ -73,9 +73,6 @@ typedef struct
 /* Get system call information.  */
 # include <sysdep.h>
 
-/* Get the thread descriptor definition.  */
-# include <nptl/descr.h>
-
 /* This is the size of the initial TCB.  Can't be just sizeof (tcbhead_t),
    because NPTL getpid, __libc_alloca_cutoff etc. need (almost) the whole
    struct pthread even when not linked with -lpthread.  */
@@ -93,6 +90,10 @@ typedef struct
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 # define TLS_TCB_AT_TP 1
+# define TLS_DTV_AT_TP 0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
 
 
 /* Install the dtv pointer.  The pointer passed is to the element with
index 59e49f743ce541fe63c440b85b18d8225a33ee7c..84e464c448c4295598eed212ba3a055d63dde3c9 100644 (file)
@@ -76,6 +76,7 @@ typedef struct
 
 /* The TLS blocks start right after the TCB.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index b10c68f34e8c56a3a50e5350e3ae4f7b4736e225..755bc23e5713583fa9abe8ac950003634dab6030 100644 (file)
@@ -69,9 +69,6 @@ typedef struct
 /* Get system call information.  */
 # include <sysdep.h>
 
-/* Get the thread descriptor definition.  */
-# include <nptl/descr.h>
-
 register struct pthread *__thread_self __asm__("%g7");
 
 /* This is the size of the initial TCB.  Can't be just sizeof (tcbhead_t),
@@ -91,6 +88,10 @@ register struct pthread *__thread_self __asm__("%g7");
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 # define TLS_TCB_AT_TP 1
+# define TLS_DTV_AT_TP 0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
 
 /* Install the dtv pointer.  The pointer passed is to the element with
    index -1 which contain the length.  */
index cbb5e9e5bd6a9c394dc32826d602d7f807b08c9c..30bd4495280f87acacfeec1aa982a087e3423f4d 100644 (file)
@@ -92,10 +92,6 @@ typedef struct
 /* Get system call information.  */
 # include <sysdep.h>
 
-
-/* Get the thread descriptor definition.  */
-# include <nptl/descr.h>
-
 #ifndef LOCK_PREFIX
 # ifdef UP
 #  define LOCK_PREFIX  /* nothing */
@@ -121,6 +117,10 @@ typedef struct
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 # define TLS_TCB_AT_TP 1
+# define TLS_DTV_AT_TP 0
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
 
 
 /* Install the dtv pointer.  The pointer passed is to the element with
index eca733ca7c0dfce9e5285ebf3e4ad5c70c715a0b..61aeabc30bfb93759c0d293bd7a74535192bd75f 100644 (file)
@@ -1,3 +1,7 @@
+2014-02-28  Roland McGrath  <roland@hack.frob.com>
+
+       * sysdeps/hppa/nptl/tls.h (TLS_TCB_AT_TP): New macro.
+
 2014-03-05  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/hppa/fpu/libm-test-ulps: Remove individual test ulps.
index 2880ad320391a39b53b39214526c5eadc4e8b17c..38132b0bb1ee69a03085043e7dd4e5ec27c36f3d 100644 (file)
@@ -51,6 +51,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index f03c5195dd1bc802298877c5a0f96f9e5e654629..ae2e6c4fae6d74607c998a7c0bfaeed9f120c84d 100644 (file)
@@ -48,6 +48,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 4894f0b6bcf5f2528b85ecb2ed482c189eb5018f..b2e082d5482e7032a81488e2f8fe83fdb63d158e 100644 (file)
@@ -42,6 +42,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 8cc0a62173d9e3224c5c62224ed4dc9ec261d172..1a2d606ba7adcee9921e3e85fc84cb7f480b4c61 100644 (file)
@@ -49,6 +49,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 279d107d3928f17568341a580c274a1e74597575..3f9225a31f894af15bd7f012f9d55cd4724f04bd 100644 (file)
@@ -87,6 +87,7 @@ register struct pthread *__thread_self __asm__("r13");
 
 /* The DTV is allocated at the TP; the TCB is placed elsewhere.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 5de079b9d4f7490adfdad3185bacc4ed294beb06..471775a3b948105107e1b058d0104f7bd7e9a826 100644 (file)
@@ -49,6 +49,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 3f84300206bddff811429765c17c7667f9b05a7f..845d53dbaf513434b02ac16d205d85f990bc794d 100644 (file)
@@ -26,6 +26,7 @@
 /* The TCB can have any size and the memory following the address the
    thread pointer points to is unspecified.  Allocate the TCB there.  */
 #define TLS_TCB_AT_TP  1
+#define TLS_DTV_AT_TP  0
 
 #ifndef __ASSEMBLER__
 
index 4cfbdd3663d5eb4d60c2baeab09273d57ab0284e..71f1dd990f710994c6a9f919eda10665935b2747 100644 (file)
@@ -48,6 +48,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP  1
+# define TLS_TCB_AT_TP  0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index 0a8da54146a409663d6a4e98447bb4b5a4a8685c..754d4e47dc5044ba7bb50b11f266b534d5f511a0 100644 (file)
@@ -67,6 +67,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* Get the thread descriptor definition.  */
 # include <nptl/descr.h>
index d226188fea6bf2878ccbbf8d8568c7c7c0cdc5e2..2a9bbc1b0496dcd581516730a74a05d6f59b25c6 100644 (file)
@@ -49,6 +49,7 @@ typedef union dtv
 
 /* The TP points to the start of the thread blocks.  */
 # define TLS_DTV_AT_TP 1
+# define TLS_TCB_AT_TP 0
 
 /* We use the multiple_threads field in the pthread struct */
 #define TLS_MULTIPLE_THREADS_IN_TCB    1