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 15:43:50 EDT
- Cc: 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.
I mostly agree with that, but the flip side is that having some things
signed and some unsigned and warning when they are mixed increases the
changes of having the compiler detect the wrong type of value being passed
to a function or used in an expression. This is what I meant when I said
it made things more strongly typed.