#pragma <9008132133.AA18275asugar-bombs.ai.mit.edu>

sun!Eng!khb sun!Eng!khb
Mon Aug 13 17:34:27 PDT 1990



>> rms:......
>> 
>> Consider: a #pragma that changes the semantics of a program will be
>> implemented only by certain compilers.  The program will work
>> incorrectly on other ANSI C systems.

In the Fortran universe, there are many counterexamples to this.
Consider the very common

c$dir ivdep
	do 100 i=1,n
	   stuff
100     continue

Compilers which would otherwise attempt dependency analysis (necessary
for highly optimizing compilers) are informed that they shouldn't
bother, that this loop is "OK". Other compilers simply don't care.

If the FortranFolk used the reasoning suggested, they would be forced
to write something like

	pardo 100 i = 1, n
	     stuff
100     continue

Which reduces portability.

Just as one should not overuse #pragma, one shouldn't force overuse of
#ifdef.



More information about the Numeric-interest mailing list