This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: signed vs unsigned comparison warnings


    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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]