C preprocessor: undefined control

Dan Ts'o dan at rna.UUCP
Sun Mar 19 12:38:25 AEST 1989


	I'm sure this must have been covered before, but I haven't seen it
myself...

	I am writing a (large) C program that runs under both UNIX and
MSDOS. I am using the Microsoft 5.0 C compiler for MSDOS and 4.3BSD's CC
for VAX UNIX. There is a portion of code that only is relevant under MSDOS.
It is surrounded by #ifdef MSDOS -> #endif. Within that code, I use MSC's
#pragma loop_opt(off) to suppress the loop optimization of a (volatile)
device register.
	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

	I naturally see how this could happen, although I do consider it a
bug (what does ANSI say about this sort of thing). Is there any way around
this ? (I know I could write the C code such that the #pragma isn't
necessary... that's not an answer).

	Please email responses. Thanks.

				Cheers,
				Dan Ts'o		212-570-7671
				Dept. Neurobiology	dan at rna.rockefeller.edu
				Rockefeller Univ.	...cmcl2!rna!dan
				1230 York Ave.		rna!dan at nyu.edu
				NY, NY 10021		tso at rockefeller.arpa
							tso at rockvax.bitnet



More information about the Comp.lang.c mailing list