signed vs unsigned comparison warnings

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Tue Jun 20 13:25:00 GMT 2000


    If you are sure the value is positive, you can use shifts instead of
    division, or am I missing something ?

First of all, division is faster for all divisors, just more so for
power-of-two.  Secondly, it's messy to write it as a shift.  What's
the replacement for 

	x / BITS_PER_WORD

We'd need macros for the power of two of everything.


More information about the Gcc mailing list