Topic: Standard predefined proprocessor macros


Author: JdeBP@osmium.jba.co.uk (Jonathan de Boyne Pollard)
Date: 10 Aug 1994 09:15:49 GMT
Raw View
>That's right. The preprocessor has its own language, which isn't C or C++.
>It doesn't know about C or C++ types or keywords. It can do integer
>arithmetic, but the only type it knows about is an integer type, which
>need not correspond exactly to any C or C++ type in the implementation.
>It can evaluate logical expressions, but does not predefine 'true' or
>'false' (or 'NULL' or any other symbolic constant).

Doesn't it even predefine __STDC__, __cplusplus and their ilk ?

Or do I have the wrong idea as to what a symbolic constant is ?

    JdeBP





Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 10 Aug 1994 22:25:43 GMT
Raw View
In article r8s@silver.jba.co.uk, JdeBP@osmium.jba.co.uk (Jonathan de Boyne Pollard) writes:
>>That's right. The preprocessor ...
>> can evaluate logical expressions, but does not predefine 'true' or
>>'false' (or 'NULL' or any other symbolic constant).
>
>Doesn't it even predefine __STDC__, __cplusplus and their ilk ?
>
>Or do I have the wrong idea as to what a symbolic constant is ?

Sorry, I misspoke. I should have left out the part in parentheses.

What I meant to say was that the stuff in the standard C or C++ headers is
not known in advance to the preprocessor, but that was irrelevent anyway.
When you include a header, any macros (like NULL) become known at that point.

And, yes, a number of symbolic constants are predefined in the preprocessor.
The Standard mandates some, and implementations are free to add as many
others as they like, as long as the names are in the implementor's name space.

---
Steve Clamage, stephen.clamage@eng.sun.com