Dumb question: What IS a trigraph?

Karl Heuer karl at haddock.ima.isc.com
Sat Aug 19 03:21:38 AEST 1989


In article <10762 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <3566 at uwovax.uwo.ca> 2014_5001 at uwovax.uwo.ca writes:
>>What is a trigraph???
>
>There's one (the "???").

Lest anyone take that too literally, I'll point out what I'm sure Doug already
knows: although all trigraphs begin with "??", not everything beginning with
"??" is a trigraph.  In particular, "???" is not one of the nine trigraphs,
and so it would not be interpreted specially.  (Unless the next character is
one of   ( ) ! = < > / - '   in which case the first `?' is literal and the
other two are the first two-thirds of a trigraph.)

In article <5940008 at hpcupt1.HP.COM> swh at hpcupt1.HP.COM (Steve Harrold) writes:
>[It's possible to accidentally create a trigraph in a string literal.]
>The compilation will succeed without comment...

Hopefully, most complete% implementations of ANSI C will warn about "possibly
unintended trigraph", especially if a trigraphable character (i.e., one of the
nine characters   [ ] | # { } \ ~ ^   ) is encountered in the same source.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
% There will undoubtedly be many "incomplete" implementations that don't
  support trigraphs.  I reserve judgement on whether this is good or bad.



More information about the Comp.lang.c mailing list