"Numerical Recipes in C" is nonportable code

Rob Carriere rob at kaa.eng.ohio-state.edu
Sun Aug 28 10:56:09 AEST 1988


In article <13258 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
> [ still on the b = malloc( foo );  bb = b - 1; code in NumRecipes ]
>Such an implementation will ABORT ON THE COMPUTATION `b - 1',
>possibly (indeed, preferably) at compile time.  And it is legal!

So the standard says, they tell me.  It is also one the more flagrant
violations of the Principle of Least Astonishment I've seen in a
while.  In fact, while we're at it, it would seem to violate the idea
that you give the programmer all the rope she asks for, because she
just might be needing it to pull herself out of a bog.  Gentlemen
system programmers, surely you too have algorithms that are more
accurately expressed with arrays from other than base zero?



More information about the Comp.lang.c mailing list