Forbid VLA as static variables
commit85f6fad3a6acbfa07a3dc45b673965fc26890d8e
authorThomas Preud'homme <robotux@celest.fr>
Thu, 25 Oct 2012 16:07:13 +0000 (25 18:07 +0200)
committerThomas Preud'homme <robotux@celest.fr>
Thu, 25 Oct 2012 16:07:13 +0000 (25 18:07 +0200)
tree07494b6050877da49c844a52a3e33df884f35be2
parent9966fd4eaea163439a63d63d044d0657df1908ea
Forbid VLA as static variables

Currently, VLA are not forbidden for static variable. This leads to
problems even if for fixed-size array when the size expression uses the
ternary operator (cond ? then-value : else-value) because it is parsed
as a general expression which leads to code generated in this case.

This commit solve the problem by forbidding VLA for static variables.
Although not required for the fix, avoiding code generation when the
expression is constant would be a nice addition though.
tccgen.c