This is the mail archive of the
mailing list for the GCC project.
Re: Var length array's vs. const int
- To: gcc at gcc dot gnu dot org
- Subject: Re: Var length array's vs. const int
- From: Gordon Sadler <gbsadler1 at lcisp dot com>
- Date: Sat, 11 Aug 2001 14:09:07 -0500
On Sat, Aug 11, 2001 at 07:08:18PM +0100, Joseph S. Myers wrote:
> On Sat, 11 Aug 2001, Gordon Sadler wrote:
> > The final sentence there is the relevant one. Is there some reason
> > gcc doesn't consider 'const int' an integer constant expression when
> Re-read 6.6, which defines integer constant expressions. Compare ISO/IEC
> 14882 subclause 5.19 [expr.const] which defines them for C++, and be
> careful not to confuse C and C++ here.
Thanks for pointing this out. I've been mixing the languages at various
times, and never had the actual standard until recently.
If I read it correctly, the difference lies in the c++ standard allowing
for const variables to qualify as an expr.const. Thanks for the