|
|
Keith Thompson <kst-u@xxxxxxx> wrote:
>
> (I wonder which is more common in real-world code, deliberate use of
> trigraphs or accidental use of trigraphs.)
The obvious place to go for answers to such questions is Derek Jones's
Economic and Cultural Commentary on the C Standard
(<http://www.knosof.co.uk/cbook/cbook.html>). Unfortunately, it doesn't
address this question other than to note:
There are insufficient trigraphs in the visible form of the .c
files to enable any meaningful analysis of the usage of
different trigraphs to be made.
and:
The visible form of the .c files contained 593 (.h 10) instances
of two question marks (i.e., ??) in string literals that were
not followed by a character that would have created a trigraph
sequence.
None of the trigraph sequences seem particularly likely to occur
accidentally, although one could certainly claim that ??! and ??) should
be expected to crop up occasionally. Since there are people who
deliberately use trigraphs, I would expect deliberate use to be more
prevalent than accidental use, but I have no hard data to back that up.
(And I'm disappointed [and a little surprised] to find that Derek
doesn't, either. Not that I'm criticizing, mind you; at 1600+ pages,
one can hardly accuse him of being a shirker!)
-Larry Jones
I'm not a vegetarian! I'm a dessertarian. -- Calvin
|
|