Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!decwrl!amdcad!lll-crg!topaz!bentley!kwh From: kwh@bentley.UUCP (KW Heuer) Newsgroups: net.lang.c Subject: Re: Arcane C hacks? Message-ID: <592@bentley.UUCP> Date: Sat, 22-Feb-86 19:37:43 EST Article-I.D.: bentley.592 Posted: Sat Feb 22 19:37:43 1986 Date-Received: Wed, 26-Feb-86 03:29:32 EST References: <184@bu-cs.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner Lines: 11 In articles <184@bu-cs.UUCP> bu-cs!bzs (Barry Shein) writes: >declare a table something like: int (*funtable[MAXFNS])() ; >and just malloc the storage for the generated code. ... It should be >quite portable (code generator aside) and is legal C. Well, some compilers will dislike the attempt to cast a (char *) into a (int (*)()) ; in fact I think some will call it an outright error (not just a warning). But in any case it is _not_ portable to the 3b2, because all programs are pure -- you can't goto/call data space, nor can you read from the instruction stream. Some sort of chastity belt in the hardware, I think.