"Numerical Recipes in C" is nonportable code

Doug Gwyn gwyn at smoke.ARPA
Sun Sep 18 06:14:53 AEST 1988


In article <16041 at ism780c.isc.com> marv at ism780.UUCP (Marvin Rubenstein) writes:
-But consider what might have happened had dpANS mandated that the compution
-of a pointer to x[-1] be a valid operation.  Then machines for wich the
-mandated behavior is slow would be not used by people interested in high
-performance.  The net effect could be salubrious for the computer industry in
-the long run.

I doubt that any effect on the computer industry would have occurred
other than reduced adherence to the postulated C standard.  People
writing portable applications would still not be able to compute
&array[-1], since several compilers would ignore that requirement
(benchmark speed is a far greater driving factor than the desires of
a few sloppy programmers to compute non-existent addresses).  What
good would that situation accomplish?  Better that the standard be
widely followed and that programmers become better educated about
actual portability considerations, than to encourage false hopes for
availability of features that are difficult or detrimental to provide.



More information about the Comp.lang.c mailing list