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: Andreas Schwab <schwab at suse dot de>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 13 Oct 2015 16:05:09 +0200
- 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> <561D0C76 dot 2000900 at redhat dot com>
Florian Weimer <fweimer@redhat.com> writes:
> On 10/13/2015 03:49 PM, Andreas Schwab wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> diff --git a/sysdeps/unix/sysv/linux/mmap64.c b/sysdeps/unix/sysv/linux/mmap64.c
>>> index 1c9d3c1..8d5b0a4 100644
>>> --- a/sysdeps/unix/sysv/linux/mmap64.c
>>> +++ b/sysdeps/unix/sysv/linux/mmap64.c
>>> @@ -46,7 +46,7 @@ __mmap64 (void *addr, size_t len, int prot, int
>>> flags, int fd, off64_t offset)
>>> }
>>> #endif
>>> if (offset & ((1 << page_shift) - 1))
>>> - return (void *) INLINE_SYSCALL_ERROR_RETURN (EINVAL);
>>> + return (void *) (ptrdiff_t) INLINE_SYSCALL_ERROR_RETURN (EINVAL);
>>
>> That's doesn't look like a good change, since you lose the warning if
>> INLINE_SYSCALL_ERROR_RETURN returns something different from the size of
>> a pointer.
>
> INLINE_SYSCALL_ERROR_RETURN (EINVAL) is of type int, so we definitely do
> not want a warning here.
INLINE_SYSCALL_ERROR_RETURN should return the same type as
INLINE_SYSCALL.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."