diff mbox

[roland/Wundef] Compile with -Wundef.

Message ID 20140314174829.5A32974443@topped-with-meat.com
State New
Headers show

Commit Message

Roland McGrath March 14, 2014, 5:48 p.m. UTC
> > --- a/sysdeps/mach/hurd/i386/tls.h
> > +++ b/sysdeps/mach/hurd/i386/tls.h
> > @@ -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_TCB_AT_TP	0
> 
> :-) Hmm?  (Should that have been TLS_DTV_AT_TP, I think?)

Oops.  Fixed on the branch.

> Also, not relevant for Hurd but for NPTL: don't all »#ifdef
> TLS_TCB_AT_TP« need to be adapted now?  

Most existing cases are #if and all should have been.
I've just fixed the two outliers with the patch below.

> And, all the instances of »#error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP
> must be defined"« are not longer appropriate in this wording, too.

Those are still correct, since they use #if rather than #ifdef
(or #elif defined ...) in the tests.


Thanks,
Roland


2014-03-14  Roland McGrath  <roland@hack.frob.com>

	* nptl/pthread_create.c (__pthread_create_2_1): Test TLS_TCB_AT_TP
	with #if rather than #ifdef.
	* nptl/sysdeps/pthread/createthread.c (create_thread): Likewise.
diff mbox

Patch

--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -496,7 +496,7 @@  __pthread_create_2_1 (newthread, attr, start_routine, arg)
      performed in 'get_cached_stack'.  This way we avoid doing this if
      the stack freshly allocated with 'mmap'.  */
 
-#ifdef TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   /* Reference to the TCB itself.  */
   pd->header.self = pd;
 
--- a/nptl/sysdeps/pthread/createthread.c
+++ b/nptl/sysdeps/pthread/createthread.c
@@ -147,7 +147,7 @@  static int
 create_thread (struct pthread *pd, const struct pthread_attr *attr,
 	       STACK_VARIABLES_PARMS)
 {
-#ifdef TLS_TCB_AT_TP
+#if TLS_TCB_AT_TP
   assert (pd->header.tcb != NULL);
 #endif