[PATCH] powerpc: Fix compiler warning on some syscalls
Roland McGrath
roland@hack.frob.com
Wed Jan 7 23:31:00 GMT 2015
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
More information about the Libc-alpha
mailing list