"Numerical Recipes in C" is nonportable code

Peter da Silva peter at ficc.uu.net
Sat Sep 10 07:42:49 AEST 1988


In article <13454 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> -In article <640 at drilex.UUCP> dricej at drilex.UUCP (Craig Jackson) writes
   about Burroughs putting protection in the compiler...

> In article <1429 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
> -What's to stop you from doing the following:
> -
> -	Generate code in an array.
> -	Jump to the beginning of the array. *

Chris Torek noted:

> Whenever the compiler is forced to generate `iffy' code, it also generates
> tests such as tags to make sure that you do not do something like this.

So what's to stop me from writing out a load module and subverting
the protection mechanism, as I noted in my (deleted) footnote? I would
think that the perversions necessary to make 'C' safe to run on this machine
would make it sufficiently useless that a little thing like calculating
a pointer to a position before the beginning of an array is a minor
detail...

That is to say, yes... this construct is non-portable. But only to machines
you would have severe problems porting to in the first place.
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?"            peter at ficc.uu.net



More information about the Comp.lang.c mailing list