This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/20426] error: initializer element is not constant
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2005 13:28:20 -0000
- Subject: [Bug other/20426] error: initializer element is not constant
- References: <20050311131232.20426.pluto@pld-linux.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From falk at debian dot org 2005-03-11 13:28 -------
(In reply to comment #0)
> # test.c
> static const unsigned major = 0;
> static const unsigned minor = 9;
> static const unsigned build = 1;
> const unsigned version = (major << 24) | (minor << 16) | build;
>
> # gcc -c test.c
> test.c:4: error: initializer element is not constant
>
> Hmm, which initializer isn't constant? Do I missed something?
"major", for example, is not a constant expression. It might not make a lot
of sense, but that's the way the C standard defines it.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20426