On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer <[email protected]> wrote:

> Author: cem
> Date: Fri Jan 19 04:34:06 2018
> New Revision: 328159
> URL: https://svnweb.freebsd.org/changeset/base/328159
>
> Log:
>   Unbreak i386 build
>
>   The logical result of a right shift >= the width of a type is zero, but
> our
>   compiler decides this is a warning (and thus, error).  Just remove ccp(4)
>   from i386.
>

That may seem like the logical result, but this is actually undefined
behavior.  Per n1256.pdf, section 6.5.7:

The integer promotions are performed on each of the operands. The type of
the result is that of the promoted left operand. If the value of the right
operand is negative or is greater than or equal to the width of the
promoted left operand, the behavior is undefined.

-Ben
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to