ANSI C -- preprocessing

Oliver Steele steele at unc.UUCP
Fri Dec 19 08:45:02 AEST 1986


In article <5456 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <109 at decvax.UUCP> minow at decvax.UUCP (Martin Minow) writes:
>
>>Page 82, line 10ff.  An unrecognized #pragma should result in a diagnostic
>>message.
>
>Sorry, I can't go along with this.  The idea of #pragma is
>advisory, so such directives can generally be ignored.

This seems contradictory to the spirit of requiring variable declarations.
If I misspell a #pragma, I want to _know_, rather than have the compiler
assume I meant what I said.  If I type '#pragma signle' to force a compiler
to use single-precision library routines, I don't want to waste time trying
to find out why my code isn't faster than it is any more than I like to waste
time debugging a FORTRASH program because I've mispelled a variable name and
the compiler's automatically declared it.

Obviously I don't want a compiler shouting at me 'unknown pragma:  single'
when I port the program.  Perhaps a '#pragma pragmas (single, foo, bar)'
to tell the compiler 'These are the pragmas I mean to use.  Don't tell
me if you don't know what they mean, but warn me about any other
pragmas you don't recognize.' would solve things (in fact, a compiler
that silently ignored unrecognized pragmas could go ahead and ignore
this one).  Sure, it's creeping featurism, but so are pragmas in the
first place, and I'd rather have an extra feature than a compiler that
ignores potential errors.
-- 

Oliver Steele----------------------------------steele at unc
When a tree dies,	  ...!{decvax,ihnp4}!mcnc!unc!steele
plant another in its place.	steele%unc at csnet-relay.csnet



More information about the Comp.lang.c mailing list