3B2 cpp #ifdef + #include

Karl Heuer karl at haddock.ISC.COM
Sat Apr 2 05:24:25 AEST 1988


In article <4419 at chinet.UUCP> les at chinet.UUCP (Leslie Mikesell) writes:
>>|   #ifdef vms
>>|   #ifdef foo$bar /* a valid name, in VMS */
>>|   #endif
>>|   #endif
>
>In the case of the 3B2 compiler, this will give a "bad include syntax" error
>regardless of the contents of the filename.  Anything not inside of quotes or
><>'s will give this error (in spite of the fact that it is inside of a false
>#ifdef).  Does VMS require the filename to be unquoted?

As I indicated in a recent posting, the fact that the SVR3 cpp pays attention
within a false #ifdef must be considered a bug.  But you misread what you
quoted; that was an "#ifdef", not an "#include".  It was complaining about the
"$" in the identifier passed to "#ifdef".

There *is* another bug of the same nature, where SVR3 cpp complains about
"#include junk".  This is independent of VMS: it's quite legal (in ANSI C,
anyway) to say "#define junk <stdio.h>" and then "#include junk".

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list