Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Bug in ANSI C??
Message-ID: <1988Feb23.205126.7977@utzoo.uucp>
Keywords: memcmp, memmove, strcmp, memcmp
Organization: U of Toronto Zoology
References: <5331@cit-vax.Caltech.Edu>
Date: Tue, 23-Feb-88 20:51:12 EST

> ...  The reason
> for allowing the indeterminacy in strcmp()'s return sign when the
> differing characters have the high bit set is simply because that is
> the way C "plain" chars are, so that is in fact how existing implementations
> behave.

Unfortunately, the wording also appears to allow indeterminate results from
strcmp("aX", "a") where X is a high-bit character... which is WRONG!  The
lexical ordering of those two strings is well-defined regardless of char
signedness or collating sequence; allowing implementation-defined results
here makes strcmp almost useless in high-bit environments.
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry
