VLA/VM [*] bug fixes for C

Joseph S. Myers joseph@codesourcery.com
Wed May 10 19:39:00 GMT 2006


On Wed, 10 May 2006, Andreas Schwab wrote:

> Mike Stump <mrs@apple.com> writes:
> 
> > Speaking of typeof, should typeof (vla) follow the same rules as for
> > sizeof (vla)?  vla, evaluate, otherwise, no eval.
> 
> How would typeof be able to eval anything?

If you have "typeof ((int (*)[f()])g())", clearly you need to evaluate the 
call f() in order to know the type being referred to.  As such, I think 
the logical conclusion is to evaluate the argument of typeof whenever of 
VM type (and so evaluate the call g() as well).

With VLAs, type names (in declarations, sizeof, typeof, casts and compound 
literals) can need to be executed for their side-effects.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc mailing list