home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19121 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  1.7 KB

  1. Path: sparky!uunet!psinntp!heimdall!thor!scjones
  2. From: scjones@thor.sdrc.com (Larry Jones)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Questions about token merging and trigraphs
  5. Message-ID: <266@heimdall.sdrc.com>
  6. Date: 1 Jan 93 20:46:29 GMT
  7. References: <mcdonald.625@aries.scs.uiuc.edu> <yoF4VB1w165w@quest.UUCP> <16297@goanna.cs.rmit.oz.au>
  8. Sender: news@heimdall.sdrc.com
  9. Lines: 25
  10.  
  11. In article <16297@goanna.cs.rmit.oz.au>, ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
  12. > It is so easy to check for unintended digraphs and so easy to fix them
  13. > that I don't actually worry about this.  I do find it amusing, though,
  14. > that the easy fix (changing ?? to ?\?) involves one of the very characters
  15. > that has a trigraph (??/ => \).  Suppose we decide to use the trigraph for
  16. > backslash, and instead of writing ?\? write ???/?.  Unfortunately, that
  17. > won't be parsed correctly, because ??? is not one of the recognised
  18. > trigraphs, it will be left untouched.  You _must_ use ?\? or string
  19. > pasting to break up the question marks.  And if you _can_ use ?\?, you
  20. > didn't need trigraphs.
  21.  
  22. Not so.  ANSI 2.2.1.1 Trigraph Sequences says (in part):
  23.  
  24.     No other trigraph sequences exist.  Each ? that does not
  25.     begin one of the trigraphs listed above is not changed.
  26.  
  27. Note that it says each ? that does not begin a valid trigraph is left
  28. alone, not each sequence.  Thus, ???/? is parsed correctly: ??? is not
  29. a valid trigraph, so the first ? is left unchanged, ??/ is a valid
  30. trigraph and so is replaced by \, and the final ? is also left alone
  31. resulting in ?\?.
  32. ----
  33. Larry Jones, SDRC, 2000 Eastman Dr., Milford, OH  45150-2789  513-576-2070
  34. larry.jones@sdrc.com  or  ...uunet!sdrc!larry.jones
  35. I hope Mom and Dad didn't rent out my room. -- Calvin
  36.