How can I find out cc or cpp symbols?

Ed Gould ed at mtxinu.COM
Tue May 9 05:02:13 AEST 1989


Greg Noel:
>>I've wondered why the ANSI committee didn't simply mandate that there
>>be a header file, say <default.h>, that was implicitly #included, and
>>that contained all the machine-specific, system-specific, and
>>vendor-specific names.

Doug Gwyn:
>[It was not suggested] in that form, that I recall, but there were a
>variety of suggestions for ways to "standardize" such parameterization
>of the environment.  Basically the use of macros for denoting specific
>operating systems and hardware doesn't seem to be fine-grained enough.

I think Doug missed the point of the question.  Remember that the
original discussion was about how to determine what names are defined
in the local environment.  The question is not what to define, but
where to define it.  As I understand the suggestion, the <default.h>
file would contain all of the names defined in the local environment
that weren't absolutely required by the standard.  Thus, for example on
a Vax Unix system (using pre-ANS names), it might contain, among other
things,

	#define	unix	1
	#define	vax	1

(By "absolutely required" I mean those names that are specifically
required and that the name and value of which are stated in the
standard.  There may be none other than _STDC_ [or however that one is
spelled]).

By examining <default.h> the user could determine exactly what would be
predefined.  It might be that there would need to be special handling
of this file, so that -U would be meaningful:  <default.h> might need
to be read before parsing command-line arguments.  But that's no
different than having the symbols hard-coded into the compiler (or
pre-processor, in this case).

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
ed at mtxinu.COM		    +1 415 644 0146

"I'll fight them as a woman, not a lady.  I'll fight them as an engineer."



More information about the Comp.unix.questions mailing list