Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2018 22:38:56 -0600
From:      Benjamin Kaduk <bjkfbsd@gmail.com>
To:        Conrad Meyer <cem@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r328159 - head/sys/modules
Message-ID:  <CAJ5_RoAhGgkQTLXgHpYYOiupA=c6wK%2BpeAdT0Zjaw0n-ggAd1g@mail.gmail.com>
In-Reply-To: <201801190434.w0J4Y6i7086677@repo.freebsd.org>
References:  <201801190434.w0J4Y6i7086677@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 18, 2018 at 10:34 PM, Conrad Meyer <cem@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ5_RoAhGgkQTLXgHpYYOiupA=c6wK%2BpeAdT0Zjaw0n-ggAd1g>