Re: somebody dropped a (warning) bomb

Jan Engelhardt
2007-02-08T21:12:19Z

On Feb 8 2007 11:53, Linus Torvalds wrote:
>On Thu, 8 Feb 2007, Jan Engelhardt wrote:
>>
>Exactly because "char *" doesn't have a defined sign,
>The user has clearly stated "I don't care about the sign". If a compiler
>complains about us passing "unsigned char *" (or, if "char" is naturally
>unsigned on that platform, "signed char *") to strcmp then that compiler
>IS BROKEN. Because "strcmp()" takes "char *", which simply DOES NOT HAVE a
>uniquely defined sign.

Thank you for this insight, I don't usually read standards, only RFCs :)
Uh, does that also apply to the longer types, int, long etc.? I hope not.

>only a TOTALLY INCOMPETENT compiler will warn about its signedness.
>That's why we can't have -Wpointer-sign on by default. The gcc warning is
>simply *crap*.
>[...]
>It really is that simple. gcc is broken. The C language isn't, it's purely
>a broken compiler issue.

Maybe you could send in a patch to gcc that fixes the issue?

Jan
--