Mail Archives: djgpp/1999/06/14/03:30:31
Scott Brown <skb AT xmission DOT removethis DOT com> wrote in message
news:37606970 DOT 14959285 AT news DOT xmission DOT com...
> ((int(*)(int, char *))p3)(99, "done");
>
> Is this a safe thing to do? Can a data pointer be safely interchanged
> with a function pointer?
It is okay to do that, but you need to know what you are doing and
check your code very carefully to make sure you don't accidentally
``call'' a data pointer. When the compiler sees a type cast, it turns
off many (if not all) of its diagnostics warnings, assuming that you
know what you are doing, so you are on your own.
> If it's okay under DOS/DJGPP, will it still work after I port my
> program to Unix/GCC?
It should work in any C compiler.
> Second question: When my DJGPP program executes a non-DJGPP DOS
> program as a child process, is the child's conventional memory space
> affected by my program's memory allocations? Is DJGPP's conventional
> memory footprint consistent and/or predictable?
These questions are answered in section 15.8 of the DJGPP FAQ list.
If something there isn't clear enough, please ask specific questions.
> Are there any ways I can minimize that footprint for the duration of
> the system/spawn call?
Not really. However, given that the conventional mmeory footprint is
usually extremely small, do you have any real problems? If so, please
describe them.
- Raw text -