This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/6] Use INLINE_SYSCALL_ERROR_RETURN
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 13 Oct 2015 07:52:43 -0700
- Subject: Re: [PATCH 2/6] Use INLINE_SYSCALL_ERROR_RETURN
- Authentication-results: sourceware.org; auth=none
- References: <20151012231944 dot GA27441 at intel dot com> <561D0388 dot 8030206 at redhat dot com> <CAMe9rOqC+Bar9XVrTutMJuo15qtiwts8AL-UMpaPQPc+WxXqNw at mail dot gmail dot com> <mvmfv1ex4iq dot fsf at hawking dot suse dot de> <CAMe9rOq_-0JngUXnHhnKcRJGkMwAjJRTiVguHVZXmgNWEn7orA at mail dot gmail dot com> <561D0DF3 dot 4090507 at redhat dot com> <CAMe9rOoJoJXTjanJKArTPNKK5jNQTvZ2XfnRYfzy+p=6X8O=YQ at mail dot gmail dot com> <mvm1tcyx3ce dot fsf at hawking dot suse dot de>
On Tue, Oct 13, 2015 at 7:14 AM, Andreas Schwab <schwab@suse.de> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Tue, Oct 13, 2015 at 6:58 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>> On 10/13/2015 03:56 PM, H.J. Lu wrote:
>>>
>>>> It looks (ptrdiff_t) isn't needed.
>>>
>>> It's not needed on x86_64, but we don't know if there will be
>>> architectures which will eventually need it (or already do). The
>>> existing code had -1L, so I assumed it was better to play it safe and
>>> mirror that.
>>
>> Yes, the cast is also needed on x86-64 if __syscall_error is used:
>>
>> [hjl@gnu-tools-1 tmp]$ cat x.c
>> #include <stddef.h>
>>
>> extern int __syscall_error (void);
>
> __syscall_error returns long on x86_64.
>
In this case, (ptrdiff_t) isn't need.
--
H.J.