Re: Apprarently simple signal/event question



On Mon, Dec 13, 1999 at 10:25:41PM -0500, Havoc Pennington wrote:
> Paul Carter <carterp@acm.org> writes: 
> > Actually, it's very common for integal return values to be left in a
> > register, not in memory. So returning a value would not cause memory
> > corruption. For example, on x86, gcc leaves the return value in the
> > EAX register.

As far as I know: in C it is the callie who restores the stack (if
needed) so calling a function with different return type then
expected shuld not matter. Unless You try to use the returned
value or return a value that need to be used (ie a ponters that
need to be freed).

> Still, it seems like a Bad Idea (tm) to rely on this. ;-)

Defenitly. If You just make the types mach You don't have to worry
about thes detailes, You don't have to worry about odd implementations
and most important:

Other hackers don't need to worry about this beeing a bug or not ;-)

/Lars

-- 
Lars Hallberg                         Micro++  www.micropp.se/
Freeware * C/C++ * Python * Linux * Debian * HTML * Javascript



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]