Re: [patch cr 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v7

H. Peter Anvin
2012-01-30T21:12:50Z

On 01/30/2012 11:58 AM, Jonathan Corbet wrote:
>
> That's a cute trick, but do we know that every compiler that will ever see
> this code will use 1 for a true integer comparison? Simply spelling it
> out with an if statement might be more robust, just as efficient, and, at
> the same time, easier for others to understand.
>

This has been the case in C from the very beginning and is guaranteed by
the C standard. The number of places which will break if this isn't
true is enormous.

-hpa