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 <s...@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."
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to