Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: net.lang.c Subject: Re: CTRL(X) in ANSI standard Message-ID: <5137@elsie.UUCP> Date: Tue, 28-May-85 10:35:55 EDT Article-I.D.: elsie.5137 Posted: Tue May 28 10:35:55 1985 Date-Received: Thu, 30-May-85 02:08:01 EDT References: <10747@brl-tgr.ARPA> <507@ucsfcgl.UUCP> Organization: NIH-LEC, Bethesda, MD Lines: 23 Summary: the draft standard makes "a"[0] a constant In regard to #define CTRL(XX) ( (#XX)[0] & '\037') in article <507@ucsfcgl.UUCP>, arnold@ucsfcgl.UUCP (Ken Arnold%CGL) writes: > . . .Unless the compiler is incredibly smart, this won't work in 'case' > statements, which is rather important. . . > Actually, when you think about it, since strings are writeable, "a"[0] > is NOT a constant, since someone else might modify the string. . . Although if I understand aright the draft standard treats unadorned doubly- quoted strings as if they were cast to "const", which means that constructs like "a"[0] would be constants under the draft standard. As for me, I still favor the #define Ctrl(X) ((X) & '\037') approach. Change your source once and be done with it. -- Ken is a Kenner Corporation trademark. -- UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado@seismo.ARPA DEC, VAX and Elsie are Digital Equipment and Borden trademarks