Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!bellcore!tness7!tness1!sugar!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: "Numerical Recipes in C" is nonportable code Message-ID: <1450@ficc.uu.net> Date: 9 Sep 88 21:42:49 GMT References: <664@lindy.Stanford.EDU> <6758@megaron.arizona.edu> <718@gtx.com> <13454@mimsy.UUCP> Organization: SCADA Lines: 27 In article <13454@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > -In article <640@drilex.UUCP> dricej@drilex.UUCP (Craig Jackson) writes about Burroughs putting protection in the compiler... > In article <1429@ficc.uu.net> peter@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@ficc.uu.net