#pragma

Chris Torek chris at trantor.umd.edu
Tue May 24 00:44:55 AEST 1988


In article <1988May23.012636.1719 at utzoo.uucp> henry at utzoo.uucp
(Henry Spencer) writes:
>...  Compilers are required to ignore unrecognized #pragmas
>(although I for one think a warning message is in order...) ....
>The description [in the dpANS] of #pragma just says "causes the
>implementation to behave in an implementation-defined manner".

I took advantage of that clause to make a version of cpp which
warns about #pragma.  The reasoning works as follows:  The
`implementation-defined' manner can be almost anything (GNU cpp
runs rogue, which appears to be perfectly legal), so long as the
compiler `recognises' the #pragma.  Hence we simply `recognise' it
by (in theory) comparing it with a regular expression---to wit,
`.*'---and print `#pragma noticed and nothing else done' as our
implementation-defined action.
-- 
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
Domain: chris at mimsy.umd.edu		Path: ...!uunet!mimsy!chris



More information about the Comp.lang.c mailing list