Mail Archives: djgpp/1999/04/25/09:25:59
On Sat, 24 Apr 1999, Randy Sorensen wrote:
> Is there some good reason why the developers of GCC for DOS (DJ, and others)
> don't implement a better system?
You cannot implement a ``better system''. The problem is that it is next
to impossible to lock code of a C function, because there's no way of
knowing the size of the code. Since the DJGPP project didn't write the
compiler, only ported it, we need to live with the compiler's limitations.
> How else are you supposed to find the size of a function?
You need to write your function in assembly, then you have an easy way
of computing its size.
Alternatively, simply lock everything by using the bit in the
__crt0_startup_flags variable, as the FAQ suggests. Then everything is
locked.
> So, the code I posted wouldn't lock the variables... but the code would be
> locked, right?
It's the other way around: the data is easy to lock, but the code and the
stack (i.e. automatic variables) are not.
- Raw text -