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: Relaxing -Wsign-compare




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).



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