public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@redhat.com>
To: sellcey@imgtec.com
Cc: GNU C Library <libc-alpha@sourceware.org>,
	Khem Raj <raj.khem@gmail.com>,
	Roland McGrath <roland@hack.frob.com>
Subject: Re: [PATCH] Fix missing err declaration in __pthread_initialize_minimal_internal
Date: Tue, 26 May 2015 18:25:00 -0000	[thread overview]
Message-ID: <5564A838.2020202@redhat.com> (raw)
In-Reply-To: <1432658526.28747.8.camel@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.

      reply	other threads:[~2015-05-26 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22 17:18 Steve Ellcey
2015-05-24 15:07 ` Carlos O'Donell
2015-05-25 11:46   ` Khem Raj
2015-05-26 17:18   ` Steve Ellcey
2015-05-26 18:25     ` Carlos O'Donell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5564A838.2020202@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=raj.khem@gmail.com \
    --cc=roland@hack.frob.com \
    --cc=sellcey@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).