[comp.sys.ibm.pc.rt] To cpp or nocpp....

schwartz@shire.cs.psu.edu (Scott Schwartz) (09/17/89)

In article <2151@ibmpa.UUCP> lmb@ghoti.uucp (Larry Breed) writes:
| You can disable cpp, and enable the ANSI preprocessor, with the
| command-line option -Hnocpp.  

I think it should be the default.  In fact, I'm going to change the
compiler driver (thank heavens we have src for that) to make it
so locally.

| Cpp is the default preprocessor on AOS because we weren't willing,
| in 1967, to try to force a nonstandard preprocessor on customers. 

1967?  Wow!  IBM is waaaaay ahead of us. :-) :-) 

But really, what is the difference between a compiler that adheres to
the new standard and a preprocessor that does?  Very little.  The
new cpp semantics are upwardly compatable with the language described in
K&R I. 

| (For one thing, Berkeley source wouldn't preprocess.)  

(Parenthetical note: the BSD source relies on a bug in the Reiser cpp
implementation that allows substitution inside of quotes.  Things like:
	#define foo(x) 'x'
This is used in the ioctl related header files.)

Only a couple header files need to be changed in order to fix this up.
In fact, the (ANSI conformant) GNU C compiler comes with a script that
will do it automagically for you.

| Yet, the language supported is ANSI C, so __STDC__ really has to be on. 

But the claim that the language is ANSI C is open to question: the
preprocessor is now offically part of the language, and if that part
is nonstandard then the whole thing is.  More importantly __STDC__ is
often used to test for the new preprocessor behavior, since the new
compiler accepts old style code without changes.

One interesting point (gleaned from comp.lang.c when this issue was
discussed there last year) is that a non conforming implementation can
-- by definition -- do whatever it wants, including defining __STDC__.

Sigh.


--
Scott Schwartz		<schwartz@shire.cs.psu.edu>
"APAR's?  We don' neeed no steeenking APARS!"