trigraphs in X3J11

Brian T. Schellenberger bts at sas.UUCP
Mon May 30 12:58:28 AEST 1988


In article <10949 at apple.Apple.Com> lenoil at apple.UUCP (Robert Lenoil) writes:
|In article <5215 at ico.ISC.COM> rcd at 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      |



More information about the Comp.lang.c mailing list