This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Relaxing -Wsign-compare
- To: Frank Klemm <pfk at fuchs dot offl dot uni-jena dot de>
- Subject: Re: Relaxing -Wsign-compare
- From: Gabriel Paubert <paubert at iram dot es>
- Date: Fri, 21 Sep 2001 11:46:38 +0200 (CEST)
- cc: Morten Welinder <terra at diku dot dk>, <gcc at gcc dot gnu dot org>
On Thu, 20 Sep 2001, Frank Klemm wrote:
> The main problem I have with signed vs. unsigned are normal strings.
> In Germany we have so called modified vowels, also other languages have
> modified letters. These are part of ISO-646 aka ISO-8859-1. But it is
> necessary to use 'unsigned char' for characters (otherwise you tap a rich
> pool of errors):
>
> const unsigned char* text = "Erdbärtörtchen";
>
> When you are using strcmp(), it complains about sign issue:
Did you ever hear about -funsigned-char ?
OFFTOPIC: what bothers me is that people compile all Linux/PPC for
example, vene the kernel, with -fsigned-char to silence warnings which
often point to actual bugs.
Like assigning the return value of fgetc() to a plain char and then
compared with EOF which correctly issues a message that the comparison
will always be false. And then somebody intervening to claim that the
right fix was compiling with -fsigned-char. I burst into flames directed
at the offender :-), but I digress, look at the Linux/PPC archives for
more fun.
Gabriel (the only good char is the unsigned char).