This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static array with constant size
- From: "Elazar Leibovich" <elazarl at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 5 Mar 2008 08:16:53 +0200
- Subject: Re: static array with constant size
- References: <2d6bb6c0803042215l6ca85671y66dc825c21cd3117@mail.gmail.com>
I'm trying to compile the following piece of code:
static const int ln = 10;
static int ar[ln];
I'm getting:
storage size of 'ar' isn't constant
size of variable 'ar' is too large
Is the code legal? Can you provide me with references to its legality
or a discussion about it? it seems to be compilable with MS cl.exe.
Thanks