trigraphs in X3J11
William E. Davidsen Jr
davidsen at steinmetz.ge.com
Tue May 24 01:55:34 AEST 1988
In article <7937 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
| In article <5215 at ico.ISC.COM> rcd at ico.ISC.COM (Dick Dunn) writes:
| >The draft standard seems to be written in such a way that a compiler MUST
| >accept these trigraph sequences.
|
| Yes, a standard-conforming implementation MUST understand trigraphs.
This is the first case I've seen where the committee really blew it in
my opinion (yes I could live with noalias). I completely agree with the
need to do this, but as currently implemented will cause a number of
problems.
A preprocessor function could specify the trigraph inducer, with the
default "none" to avoid breaking existing programs. The committee seems
to have lost sight of that goal in this case. The same functionality
could be provided by a new preprocessor function (can't break existing
programs).
Consider:
#trigraph ??
Now your program can run on my machine, using the notation you used.
If I choose, I can run it through a filter and convert to full ASCII.
Better yet, I can take my existing programs and convert them before
sending them to you.
Why do it this way? If I want to send you a program of mine, which I
wrote filled with the ?? sequence **like many machine control programs
which have to get certain ASCII characters to the device** I can give
you another sequence:
#trigraph TX
This is ugly as hell, but it will let you edit the program, and not
break it.
PLEASE X3J11, fix this sucker! It CAN be done without breaking
existing programs. It makes more sense in the preprocessor. Best
reason is that as specified it will lead to compilers which don't do
full ANSI by default, or even subset compilers.
I scanned my local source directory and found three programs of 102
which would break. I don't know if that's typical, but why do it wrong
when it can be done another way. I did NOT scan the directory of
programs which do device control, since I have made that point and every
one would break and have to be handcoded with escape sequences, etc, do
get by this.
--
bill davidsen (wedu at ge-crd.arpa)
{uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me
More information about the Comp.lang.c
mailing list