Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/string



On Mon, Apr 19, 2010 at 03:02:05AM +0000, Christos Zoulas wrote:
> In article <20100419021334.GA8829%britannica.bec.de@localhost>,
> Joerg Sonnenberger  <joerg%britannica.bec.de@localhost> wrote:
> >On Sun, Apr 18, 2010 at 10:51:35AM +0000, Alan Barrett wrote:
> >> Log Message:
> >> Bitwise operations on signed types are well-defined if the values
> >> happen to be positive, and indeed the values here were guaranteed
> >> to be positive, but some compilers complained anyway, so convert
> >> the bitwise operations to arithmetic operations.
> >
> >In that case use an explicit cast to the unsigned type. What you did is
> >penalize the code for no good reason.
> 
> Any compiler these days knows how to do these micro-optimizations.

For *unsigned* that is easy. For *signed* it is a lot harder.

Joerg


Home | Main Index | Thread Index | Old Index