This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] hppa: Add _STACK_GROWS_* cases to pthread_attr_[sg]etstack.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 06 Mar 2014 01:48:23 -0500
- Subject: Re: [PATCH] hppa: Add _STACK_GROWS_* cases to pthread_attr_[sg]etstack.
- Authentication-results: sourceware.org; auth=none
- References: <5316B1E5 dot 5070100 at redhat dot com> <5317B3D7 dot 10600 at redhat dot com>
On 03/05/2014 06:31 PM, Pedro Alves wrote:
> I happened to skim this patch for some reason, and
> noticed ...
>
> On 03/05/2014 05:11 AM, Carlos O'Donell wrote:
>> +#if _STACK_GROWS_DOWN
>> iattr->stackaddr = (char *) stackaddr + stacksize;
>> +#else
>> + iattr->stackaddr = (char *) stackaddr;
>> +#endif
>> iattr->flags |= ATTR_FLAG_STACKADDR;
>
> Used #if here.
>
>> +#if _STACK_GROWS_DOWN
>> iattr->stackaddr = (char *) stackaddr + stacksize;
>> +#else
>> + iattr->stackaddr = (char *) stackaddr;
>> +#endif
>> iattr->flags |= ATTR_FLAG_STACKADDR;
>
> Used #if here.
>
>> /* Store the result. */
>> +#ifdef _STACK_GROWS_DOWN
>> *stackaddr = (char *) iattr->stackaddr - iattr->stacksize;
>> +#else
>> + *stackaddr = (char *) iattr->stackaddr;
>
> Used #ifdef here -- any particular reason for that?
None. Just sloppy. I'll fix that. Thanks for the review!
Cheers,
Carlos.