This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: signed vs unsigned comparison warnings
- To: Marc Espie <espie at quatramaran dot ens dot fr>
- Subject: Re: signed vs unsigned comparison warnings
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 20 Jun 2000 21:14:28 +0100 (BST)
- CC: kenner at vlsi1 dot ultra dot nyu dot edu, gcc at gcc dot gnu dot org
> In my experience, using unsigned in C is almost always a mistake.
> The way conversion works, it does create all sorts of nasty problems
> that don't exist with signed arithmetic, and the extra bit of precision
> is VERY rarely useful.
Using unsigned instead of signed division by a constant power of two can
make a significant difference in code size and speed.