Self-modifying code

Rakesh Dubey - grad student rdubey at eecs.wsu.edu
Tue Oct 9 04:39:22 AEST 1990


>>> svissag at hubcap.clemson.edu
>>> Re: Two Questions.

About declaring the structure, it is possible but I can see no
reason why you want to do that. Things like self-modifying code
are simply not worth it. How would you debug/understand/prove
a code that modifies itself. And you are trying a higher level
programming language, would you modify the C source code statements
and recompile everything. 
Coming back to the original point, this is the way you *can* do it.
But it sure is stupid. 
1. Read the name of the structure and kind of things the user wants
to be in it. (Range, type, limits etc.)
2. Creat a file containing C source code which defines such a structure.
3. Now exec a Makefile which compiles your source code file and
this brand new one you created just now. You will finally have a new
process running.
This might be called self-modifying higher level code and many extensions
come to mind. But there will be bunch of problems too. Though I *think*
you can do it, but you shouldn't be needing such tricky/unreliable
kind of stuff.
-- 

---
Rakesh Dubey
rdubey at yoda.eecs.wsu.edu



More information about the Comp.lang.c mailing list