Arcane C hacks?
Marc Mengel
aaz at pucc-j
Fri Feb 28 03:48:37 AEST 1986
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
More information about the Comp.lang.c
mailing list