From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Mitchell To: egcs@tantalophile.demon.co.uk Cc: mrs@windriver.com, gcc@gcc.gnu.org, per@bothner.com Subject: Re: GCC's statement expression extension Date: Fri, 04 Aug 2000 09:04:00 -0000 Message-id: <20000804090346I.mitchell@codesourcery.com> References: <200008032132.OAA10481@kankakee.wrs.com> <20000804133525.A8926@pcep-jamie.cern.ch> X-SW-Source: 2000-08/msg00111.html >>>>> "Jamie" == Jamie Lokier 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