Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!homxb!mtuxo!mtune!codas!killer!dcs!wnp From: wnp@dcs.UUCP (Wolf N. Paul) Newsgroups: comp.lang.c Subject: Re: Bug in ANSI C?? Summary: Not a bug, but a step towards Internationalization Keywords: memcmp, memmove, strcmp, memcmp Message-ID: <16@dcs.UUCP> Date: 17 Feb 88 05:02:58 GMT References: <5331@cit-vax.Caltech.Edu> <241@oracle.UUCP> <2118@bsu-cs.UUCP> Reply-To: wnp@dcs.UUCP (Wolf N. Paul) Distribution: comp.sys.ibm.pc,comp.lang.c Organization: DCS, Dallas, Texas Lines: 45 In article <2118@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: >In article <241@oracle.UUCP> rbradbur@oracle.UUCP (Robert Bradbury) writes: >>On another note; does everyone realize that the current standard allows >>the results of the str/memcmp() function to be implementation defined >>if the characters being compared have the high-bit set? > >You mean that I can have two identical strings with high bits set, and >strcmp() could return something other than 0? This would be truly a >serious flaw in the standard. The purpose of this would be to allow the use of the "alternate" character set (= codes > 127) to be used for international language applications. Languages which have more than 26 alpha characters need the upper half of the eight-bit code range to implement their languages, and in that case ignoring the 8th bit would be very counter-productive. >Or does the problem lie only in deciding lexical order? That's not so >bad--I wouldn't trust the standard library in that case anyway, since >we all have our own opinions about what lexical order is correct. Similarly, we all have our own opinions about how many unique characters should be available -- limiting the number to 128 is more restrictive than necessary, so I think the standard is appropriate. >While we're on the subject, just what is the meaning of "implementation- >defined"? E.g., "Oh, by the way, I would avoid comparing strings >with high bits set, since the result is implementation-defined. On >this particular system the result is that all disk packs are erased and >the system halts." Hardly. Compiler implementors do want to sell more than a few copies of their product, and such behaviour would not be conducive to that goal :-) >-- >Rahul Dhesi UUCP: !{iuvax,pur-ee,uunet}!bsu-cs!dhesi ---- Wolf N. Paul Phone: (214) 306-9101 (h) (214) 404-8077 (w) 3387 Sam Rayburn Run UUCP: ihnp4!killer!{dcs, doulos}!wnp Carrollton, TX 75007 INTERNET: wnp@dcs.UUCP ESL: 62832882 Pat Robertson does NOT speak for all evangelical Christians--not for me, anyway! -- Wolf N. Paul Phone: (214) 306-9101 (h) (214) 404-8077 (w) 3387 Sam Rayburn Run UUCP: ihnp4!killer!{dcs, doulos}!wnp Carrollton, TX 75007 INTERNET: wnp@dcs.UUCP ESL: 62832882 Pat Robertson does NOT speak for all evangelical Christians--not for me, anyway!