Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bds beta 6/6/85; site pucc-j Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!pucc-j!aaz From: aaz@pucc-j (Marc Mengel) Newsgroups: net.lang.c Subject: Re: Arcane C hacks? Message-ID: <857@pucc-j> Date: Thu, 27-Feb-86 12:48:37 EST Article-I.D.: pucc-j.857 Posted: Thu Feb 27 12:48:37 1986 Date-Received: Fri, 28-Feb-86 22:39:13 EST References: <1700003@umn-cs.UUCP> <1700004@umn-cs.UUCP> Reply-To: aaz@pucc-j.UUCP (Marc Mengel) Organization: The Hacker's Liberation Front Lines: 23 Keywords: type casts,function pointers As far as I know, the following code is legal, and it works on all the machines I have ever used. It is not neccesarily portable everywhere, since some machines may not like executing in the data segment, but then again, if you are putting machine code in an array and executing it, it isn't portable code in *any* case. char foo[BIGNUM]; main() { int result; /* code to put machine code into foo[] */ result = (* (int (*)()) foo)(); } -- Marc Mengel Uucp: { decvax, icalqa, ihnp4, inuxc, sequent, uiucdcs }!pur-ee!pucc-j!aaz { decwrl, hplabs, icase, psuvax1, siemens, ucbvax }!purdue!pucc-j!aaz USnail: 910 N. 9th street Lafayette IN 47904