#pragma

Karl Heuer karl at ima.isc.com
Thu Dec 6 04:51:41 AEST 1990


In article <9012050330.AA04857 at decpa.pa.dec.com> diamond at tkou02.enet.dec.com ("diamond at tkovoa") writes:
>In that case, why should unrecognized #pragmas be ignored?

I agree that this was a bad idea.

>[Is it okay to produce a diagnostic?]

There are two available loopholes.  One is to say "there are no unrecognized
#pragma directives for us to ignore, because our implementation interprets all
forms of #pragma as a valid request to terminate the compilation."  This is
what gcc used to do (with embellishments that some found amusing), but the FSF
was pressured to change this.  (I rather liked it.)

The other approach is to emit the diagnostic "warning: unrecognized #pragma"
and continue compilation.  This is completely legal (as are all warnings%),
and I consider such an implementation to be higher quality than one which does
not do so.

Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint
________
% including such things as "comment does not match code" :-)



More information about the Comp.std.c mailing list