This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
alloca + inline
- From: Xanthakis Stelios <sxanth at ceid dot upatras dot gr>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 15 Mar 2003 20:48:19 +0200 (EET)
- Subject: alloca + inline
Hello.
I did some tests with gcc 3.2 and -as expected- alloca is preserved
in inline functions.
Which means that we can say:
static inline void *calloca (int i)
{
void *ret = alloca (i);
memset(ret, 0, i);
return ret;
}
Can you guarantee that it will always be so?
Can we consider this standard behaviour?
btw, I was searching through the archives and I found a message
which sais that inlining should be refused in functions that use
alloca. If I use the always_inline attribute, can I still to my work?
I'm not subscribed to this list, so please CC me.
Thanks
stelios