Message ID | 1432275814-4901-1-git-send-email-raj.khem@gmail.com |
---|---|
State | New |
Headers | show |
On 05/22/2015 08:23 AM, Khem Raj wrote: > Fixes build problems on mips > nptl-init.c: In function '__pthread_initialize_minimal_internal': > nptl-init.c:333:48: error: 'err' undeclared (first use in this function) I think you should move the err definition closer to its users, introducing a new scope if necessary. The use sites are conditional on preprocessor symbols, and a function-global definition might result in unused variable warnings on other architectures (which are treated as errors).
On 05/22/2015 06:02 AM, Florian Weimer wrote: > On 05/22/2015 08:23 AM, Khem Raj wrote: >> Fixes build problems on mips >> nptl-init.c: In function '__pthread_initialize_minimal_internal': >> nptl-init.c:333:48: error: 'err' undeclared (first use in this function) > > I think you should move the err definition closer to its users, > introducing a new scope if necessary. The use sites are conditional on > preprocessor symbols, and a function-global definition might result in > unused variable warnings on other architectures (which are treated as > errors). > Agreed. The err declaration should be right beside the syscall and in a new scope. Cheers, Carlos.
On 05/23/2015 10:25 PM, Carlos O'Donell wrote: > On 05/22/2015 06:02 AM, Florian Weimer wrote: >> On 05/22/2015 08:23 AM, Khem Raj wrote: >>> Fixes build problems on mips >>> nptl-init.c: In function '__pthread_initialize_minimal_internal': >>> nptl-init.c:333:48: error: 'err' undeclared (first use in this function) >> >> I think you should move the err definition closer to its users, >> introducing a new scope if necessary. The use sites are conditional on >> preprocessor symbols, and a function-global definition might result in >> unused variable warnings on other architectures (which are treated as >> errors). >> > > Agreed. The err declaration should be right beside the syscall and in > a new scope. I see you're fixing the same thing Steve is fixing. See his patch. Cheers, Carlos.
diff --git a/ChangeLog b/ChangeLog index ba7a400..ae5c8d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-15-21 Khem Raj <raj.khem@gmail.com> + + * nptl/nptl-init.c (__pthread_initialize_minimal_internal): Add + INTERNAL_SYSCALL_DECL (err). + 2015-05-21 Joseph Myers <joseph@codesourcery.com> * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Include <libc-internal.h>. diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index 5b8d931..f885c5d 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -309,6 +309,7 @@ __pthread_initialize_minimal_internal (void) used. */ __asm __volatile (""); #endif + INTERNAL_SYSCALL_DECL (err); /* Minimal initialization of the thread descriptor. */ struct pthread *pd = THREAD_SELF;
Fixes build problems on mips nptl-init.c: In function '__pthread_initialize_minimal_internal': nptl-init.c:333:48: error: 'err' undeclared (first use in this function) Signed-off-by: Khem Raj <raj.khem@gmail.com> --- ChangeLog | 5 +++++ nptl/nptl-init.c | 1 + 2 files changed, 6 insertions(+)