C preprocessor: undefined control

Dan Ts'o dan at rna.UUCP
Wed Mar 22 13:01:57 AEST 1989


In article <1989Mar20.190946.23190 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
)In article <435 at rna.UUCP> dan at rna.UUCP (Dan Ts'o) writes:
))  ...	The 4.3BSD complains about the #pragma, even though it should be
))excluded entirely since the #ifdef MSDOS is not satisfied:
))
))#ifdef MSDOS
))	... C code ...
))#pragma loop_opt(off)
))	while(...)
))	...
))#endif
))
)As I read the fine print in the Oct. draft, an unrecognized thing that
)looks like a directive, in a section that is being skipped, is not in
)fact a directive and therefore should not draw a complaint, except perhaps
)a warning message from an excessively-clever compiler.
)
)As to how to get around it, try putting white space in front of the #
)that starts the #pragma.  An ANSI-compatible compiler will recognize
)it even so, and with luck your MeSsDOS compiler will too, but the old
)compilers won't see it unless the # is first on the line.

	Thanks to everyone that responded. As far as the "4.3BSD complains",
I should have been more specific: The original 4.3BSD VAX C compiler not
only complains, it gives up entirely. I haven't tried the 4.3BSD Tahoe
compiler.
	As far as how to get around it, Henry's suggestion, which a couple
of others also offered, though kludgy, was the most satisfactory -- and it
works. That is, simply putting white space in front of the #pragma cause
the 4.3BSD C compiler to ignore it (that is, the pre-processor doesn't
realize that it should interpret the #pragma).
	...Which reminds me... Remember the days when the pre-processor
wasn't even invoked unless the first CHARACTER of the C source file was #.
The good ol' daze...



More information about the Comp.bugs.4bsd.ucb-fixes mailing list