Joe Smith wrote On 05/25/06 12:46,:
[garbled quoting snipped for clarity's sake; see up-thread]
/* begin reply */
I seem to be additionally confused by my newsreader today, as I'm not seeing
the '>' as I would expect. My guess is that the execution char set is going
to the the chars that C requires from its environment, in my case, an OS.
C is sometimes used as a cross-compiled language, where
a compiler on one system produces a program to be executed
on a dissimilar system. This sort of thing is quite common
when C programs are written to be executed in free-standing
"embedded" systems, whose hardware may be well-suited to
operating your microwave oven but ill-adapted for the job
of running a C compiler. You build the program on a machine
that has niceties like editors, compilers, file systems, and
so on, and then you (somehow) transfer the generated code
to the target machine and execute it there.
This raises the possibility that the system where the
compiler operates may use a different character set than the
system where the program runs, so the Standard is careful to
distinguish the "source character set" (the alphabet in which
the program source is written) from the "execution character
set" (the set of characters the program can use while running).
Not only can the encodings of the characters differ in the two
environments ('0' might be 48 in the source set and 240 in the
execution set), but the repertoire of available characters can
also be different.
The Standard enumerates the minimum required contents of
the two character sets. As you can see, there is a lot of
overlap; in fact, all the required source characters are also
required to exist in the execution set. (One imagines this is
to ensure that a C compiler can be written in C.) A small
number of execution-set characters, though, are not necessary
for the task of writing C source: there's little reason to
want a backspace character as part of the source alphabet, for
example. (A whimisical idea: considering how widely casts are
misused, perhaps the spelling of the cast operator ought to
involve the \a character!)
Can a person determine the status of '\n' using #ifdefs? joe
I'm afraid I don't understand the question. The execution
character set must include the newline character, so its status
is "present" in any conforming C implementation. Its role in
the source character set is a little strange, but that role
doesn't change from one implementation to the next. Its role
in the externally-stored format of C source may (does) differ
from system to system, but Translation Phase 1 smooths such
differences away -- and since #ifdefs aren't processed until
Phase 4, there are no differences left for them to test.
YMMV
you might move volvos?
your mother makes volleyballs?
Yankees in 2005. (Not!)