This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: signed vs unsigned comparison warnings
- To: espie at quatramaran dot ens dot fr
- Subject: Re: signed vs unsigned comparison warnings
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Tue, 20 Jun 00 16:37:55 EDT
- Cc: gcc at gcc dot gnu dot org
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.