[cfe-dev] clang bug: constant array size is recognized as variable array size

John Freeman freeman1 at gmail.com
Mon May 26 11:52:07 PDT 2008

Eli Friedman wrote:-

> > On Fri, May 23, 2008 at 3:17 AM, Csaba Hruska <csaba.hruska at gmail.com>
> wrote:
> > > gcc accepts it, but clang thows this:
> > >     error: variable length array declared outside of any function
> >
> > gcc is wrong here; "(unsigned int)(100.*120.)" isn't an integer
> > constant expression (per the definition in C99 6.6), so A is in fact
> > an illegal VLA per the standard. Not sure what to do here.

Perhaps it could use a better diagnostic, like:

error: array declared outside of function without integer constant length

- John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080526/e8dbe5cb/attachment.html>

More information about the cfe-dev mailing list