This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix missing err declaration in __pthread_initialize_minimal_internal
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: sellcey at imgtec dot com
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Khem Raj <raj dot khem at gmail dot com>, Roland McGrath <roland at hack dot frob dot com>
- Date: Tue, 26 May 2015 13:07:04 -0400
- Subject: Re: [PATCH] Fix missing err declaration in __pthread_initialize_minimal_internal
- Authentication-results: sourceware.org; auth=none
- References: <1432312942 dot 16668 dot 92 dot camel at ubuntu-sellcey> <55613FBA dot 1020003 at redhat dot com> <1432658526 dot 28747 dot 8 dot camel at ubuntu-sellcey>
On 05/26/2015 12:42 PM, Steve Ellcey wrote:
> On Sat, 2015-05-23 at 23:04 -0400, Carlos O'Donell wrote:
>
>> Why isn't this inside the inner ifdef?
>>
>>> #ifdef __NR_set_robust_list
>>> pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock)
>>> - offsetof (pthread_mutex_t,
>>
>> As Florian mentioned to Raj, the definition of the err decl should
>> be in the same scope as the syscall that uses it.
>>
>> Did I miss something?
>>
>> Cheers,
>> Carlos.
>
> This patch is no longer needed due to Roland's patch but the reason I
> didn't put INTERNAL_SYSCALL_DECL in the same scope as INTERNAL_SYSCALL
> was because there was multiple INTERNAL_SYSCALL calls in
> __pthread_initialize_minimal_internal and I wanted one
> INTERNAL_SYSCALL_DECL to cover them all. That was basically what we had
> before. I guess the right way (and what Roland checked in) is to have
> one INTERNAL_SYSCALL_DECL for each scope with an INTERNAL_SYSCALL and if
> you have two INTERNAL_SYSCALL's in different ifdefs but in the same C
> scope then use brackets to make different scopes so you can have a
> INTERNAL_SYSCALL_DECL with each INTERNAL_SYSCALL.
>
> I.e. do not do this:
>
> INTERNAL_SYSCALL_DECL
> #if A
> INTERNAL_SYSCALL()
> #endif
> #if B
> INTERNAL_SYSCALL()
> #endif
>
>
> but instead do this:
>
>
> #if A
> {
> INTERNAL_SYSCALL_DECL
> INTERNAL_SYSCALL()
> }
> #endif
> #if B
> {
> INTERNAL_SYSCALL_DECL
> INTERNAL_SYSCALL()
> }
> #endif
Agreed. I did see later that Roland checked in a solution.
Cheers,
Carlos.