svn commit: r328159 - head/sys/modules

Benjamin Kaduk bjkfbsd at gmail.com
Fri Jan 19 04:38:58 UTC 2018


On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer <cem at freebsd.org> 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


More information about the svn-src-head mailing list