Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!umd5!uvaarpa!mcnc!rti!sas!bts From: bts@sas.UUCP (Brian T. Schellenberger) Newsgroups: comp.lang.c Subject: Re: trigraphs in X3J11 Message-ID: <521@sas.UUCP> Date: 30 May 88 02:58:28 GMT References: <5215@ico.ISC.COM> <10949@apple.Apple.Com> Reply-To: bts@sas.UUCP (Brian T. Schellenberger) Organization: SAS Institute Inc, Cary NC Lines: 26 In article <10949@apple.Apple.Com> lenoil@apple.UUCP (Robert Lenoil) writes: |In article <5215@ico.ISC.COM> rcd@ico.ISC.COM (Dick Dunn) writes: |> Note also that it is common practice to use "?" in initializing strings |> where the "?" positions will be replaced at execution time. | |Dick is dead right here. What is the justification for breaking existing |programs when the ability to include untypeable characters into strings already |exists via the \xxx mechanism? Instead of introducing a totally new notion |(to C, anyway) of trigraphs, why not simply extend the backslash escape |mechanism to be valid outside of strings? This would allow the use of #defines |to perform the same function as trigraphs: | |#define ??< \173 /* open brace */ |#define ??> \175 /* close brace */ No, you are both DEAD WRONG here. This will break badly on the IBM, PR1ME, and other non-ASCII machines. You should *NEVER* assume anything (that the ANSI C standard doesn't guarantee) about the character set in portable programs. And if your program isn't intended to be portable, ANSI is irrelevent anyway. -- --Brian, the man from Babble-on. |Brian T. Schellenberger| ...!mcnc!rti!sas!bts | |104 Willoughby Lane |work: (919) 467-8000 x7783| |Cary, NC 27513 |home: (919) 469-9389 |