Re: Is there stack associated when a executing an inline function?



jacob navia <jacob@xxxxxxxxxx> writes:
Mahesh wrote:
I need to know if stack frames are generated in case of a
inline function execution or
do they execute just like macros?

A stack <frame> will not be generated but any local
storage that the inline function uses will be added to
the local storage of the calling function.

How do you know? Can you cite the standard to support this claim?

The implementation you describe is certainly plausible, but the
standard says nothing about stack frames, either for inline functions
or for ordinary functions. See C99 6.7.4. To the original poster: a
recent draft of the C99 standard can be downloaded in PDF format from
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>.

Briefly, the standard imposes some restrictions on inline functions,
but otherwise says only that they behave like ordinary functions.

[snip]

--
Keith Thompson (The_Other_Keith) <kst-u@xxxxxxx>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages