Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2015 17:26:52 +0300
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Dimitry Andric <dim@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r288099 - head/contrib/binutils/opcodes
Message-ID:  <20150922142652.GO21849@zxy.spb.ru>
In-Reply-To: <1442931787.1224.205.camel@freebsd.org>
References:  <201509220935.t8M9ZZfD051027@repo.freebsd.org> <20150922094301.GW3158@zxy.spb.ru> <4CD0DC75-0235-4890-827C-4FF41BBADD8A@FreeBSD.org> <1442931787.1224.205.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 22, 2015 at 08:23:07AM -0600, Ian Lepore wrote:

> On Tue, 2015-09-22 at 11:53 +0200, Dimitry Andric wrote:
> > On 22 Sep 2015, at 11:43, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
> > > 
> > > On Tue, Sep 22, 2015 at 09:35:35AM +0000, Dimitry Andric wrote:
> > ...
> > >> -			  imm |= (-1 << 7);
> > >> +			  imm |= -(1 << 7);
> > > 
> > > May be (~0 << 7) is more simple to understund?
> > 
> > This will give the same warning.  ~0 will implicitly convert to -1.
> > 
> > (It would be better to convert all these masks to unsigned, where such
> > shifting is always defined, but that gives a lot more churn.)
> > 
> > -Dimitry
> > 
> 
> How is (-1U << 7) more churn?

"There are no negative integer literals. Expressions such as -1 apply
the unary minus operator to the value represented by the literal,
which may involve implicit type conversions."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150922142652.GO21849>