This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/5336: initializer element is not constant
- From: rth at gcc dot gnu dot org
- To: dima at cc dot hut dot fi, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 30 Apr 2002 01:25:52 -0000
- Subject: Re: c/5336: initializer element is not constant
- Reply-to: rth at gcc dot gnu dot org, dima at cc dot hut dot fi, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: initializer element is not constant
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Mon Apr 29 18:25:50 2002
State-Changed-Why:
Not a bug. Constant data does not a constant expression make.
See section 6.6 of the ISO C standard. In part:
An integer constant expression shall have integer type and shall only have operands
that are integer constants, enumeration constants, character constants, sizeof
expressions whose results are integer constants, and floating constants that are the
immediate operands of casts. Cast operators in an integer constant expression shall only
convert arithmetic types to integer types, except as part of an operand to the sizeof
operator.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5336