Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: "Numerical Recipes in C" is nonportable code Message-ID: <8470@smoke.ARPA> Date: 9 Sep 88 06:57:47 GMT References: <664@lindy.Stanford.EDU> <6758@megaron.arizona.edu> <718@gtx.com> <640@drilex.UUCP> <1429@ficc.uu.net> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 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. * >... I can't see how you could write a valid 'C' compiler that wouldn't >let you violate this protection. That's simple. All the compiler has to do is detect any attempt to use a data object as a function. The only way to even attempt this in standard C is via an explicit cast to a function pointer somewhere, which is where the compiler would enforce the constraint.