This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/5336: initializer element is not constant
- From: dima at cc dot hut dot fi
- To: gcc-gnats at gcc dot gnu dot org
- Date: 9 Jan 2002 16:33:25 -0000
- Subject: c/5336: initializer element is not constant
- Reply-to: dima at cc dot hut dot fi
>Number: 5336
>Category: c
>Synopsis: initializer element is not constant
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Jan 09 08:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: dima@cc.hut.fi
>Release: 2.96 (*g*), 3.0.1
>Organization:
>Environment:
>Description:
compiler exits with error on code which is legal at least in common sense.
when comiling something like:
int * const ptr1 = (int *) 0xf0f0f0f0;
int * const ptr2 = ptr1;
compiler exits with error "initializer element is not constant", although it sorta is. it's not "a constant", but it sure is "constant".
I'll go dig C docs, if it is indeed so that init element must be "a constant expression" then a change of error message would be good.
>How-To-Repeat:
int * const ptr1 = (int *) 0xf0f0f0f0;
int * const ptr2 = ptr1;
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: