This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC - Preserving statement expression results on stack
- From: Joe Perches <joe at perches dot com>
- To: gcc-help at gcc dot gnu dot org
- Cc: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Date: Wed, 29 Aug 2007 15:23:32 -0700
- Subject: GCC - Preserving statement expression results on stack
I know that gcc preserves stack slots for statement expressions.
http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00958.html
What about statement expressions that return arrays?
When does GCC free stack used by statement expression array returns?
For instance:
#define itoa(i) \
({ char tmp[16]; sprintf(tmp, "%d", i); tmp; })
printf("%s %s\n", itoa(1), itoa(2));
is the printf output guaranteed to be "1 2" or is it undefined?