This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH roland/Wundef] Compile with -Wundef.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Fri, 14 Mar 2014 10:48:29 -0700 (PDT)
- Subject: Re: [PATCH roland/Wundef] Compile with -Wundef.
- Authentication-results: sourceware.org; auth=none
- References: <20140228232805 dot 1163D744B4 at topped-with-meat dot com> <87wqgbmz7o dot fsf at kepler dot schwinge dot homeip dot net>
> > --- 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.
--- 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