Problem with the C pre-processor

VLD/VMB gwyn at BRL.ARPA
Sun Oct 6 09:51:51 AEST 1985


If the target environment cannot support the full C character set
then it obviously cannot support an X3J11 implementation.

I was told that several committee members wanted to specify ASCII
for the character set, and that the current tip-toeing around the
issue was a compromise consensus.  The thing is, you see, ASCII
is an official standard and EBCDIC was just IBM doing its own
thing, as usual.  The properties of EBCDIC are pretty disgusting,
from a programmer's viewpoint.

I once had to cope with this issue, and decided the best thing was
to insist on all characters available inside a running program
being ASCII, with all characters outside the program being
expressed in some "host character set".  I used the toascii()
function to map into internal (ASCII) form and a new function
tohostc() to map to external (host) form.  this made it possible
to use the nice properties of the ASCII character set in my code.
On an ASCII host, these are trivial macros, and on other hosts
they are just indexed translation tables.



More information about the Comp.lang.c mailing list