This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC's statement expression extension
- To: egcs at tantalophile dot demon dot co dot uk
- Subject: Re: GCC's statement expression extension
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 04 Aug 2000 09:03:46 -0700
- Cc: mrs at windriver dot com, gcc at gcc dot gnu dot org, per at bothner dot com
- Organization: CodeSourcery, LLC
- References: <200008032132.OAA10481@kankakee.wrs.com><20000804133525.A8926@pcep-jamie.cern.ch>
>>>>> "Jamie" == Jamie Lokier <egcs@tantalophile.demon.co.uk> writes:
Jamie> [Mark: the toupper example is not correct]
Why not?
I have:
# define __tobody(c, f, a)
(__extension__
({ int __res;
...
__res = a[(int) (c)];
__res; }))
If `c' is `(a + b).c_str()[0]' then a temporary will be created for `a
+ b' when `c' is used as an array index. That temporary will be
destroyed at the end of the statement:
__res = a[(int) (c)];
inside the statement expression, which is earlier than the end of the
enclosing full expression.
I'm happy to change the documentation, but I'm confused as to why you
think your original example doesn't illustrate the problem.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com