This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Fix compiler warning on some syscalls
- From: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 08 Jan 2015 11:12:32 -0200
- Subject: Re: [PATCH] powerpc: Fix compiler warning on some syscalls
- Authentication-results: sourceware.org; auth=none
- References: <54ABDECE dot 3030306 at linux dot vnet dot ibm dot com> <87387ot233 dot fsf at igel dot home> <54ABFAD6 dot 8020008 at linux dot vnet dot ibm dot com> <54AC0560 dot 60707 at cs dot ucla dot edu> <54AC160F dot 6030403 at linux dot vnet dot ibm dot com> <20150107233151 dot 0AD132C3BC0 at topped-with-meat dot com>
On 07-01-2015 21:31, Roland McGrath wrote:
> Using &foo[0] is fine, but I think it does need a comment in each place.
> It doesn't have to be a full explanation, just something short like:
> /* Avoid implicit array coercion in syscall macros. */
> Otherwise someone will come along at some point and say, "&foo[0] is
> equivalent to foo in C, so I'll remove the superfluous operators."
> A more full explanation can go with the definition of INLINE_SYSCALL et al.
>
> It wouldn't hurt for at least some of those implementations to add a
> __builtin_classify_type check so that any array_type_class arguments to
> syscall macros (at least in machine-independent code) barf at compile time
> in a way that leads to seeing a comment that explains the situation.
>
>
> Thanks,
> Roland
>
I have added your comment suggestion and pushed upstream as
dd6e8af6ba1b8a95a7f1dc7422e5ea4ccc7fbd93.