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: "pluto at pld-linux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2005 14:20:01 -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 pluto at pld-linux dot org 2005-03-11 14:19 -------
(In reply to comment #2)
> Note in C++ they will be constants though but not in C. C has different rules
for constant expressions
> than C++.
Thanks for explain. I have one more basic question.
Why the non-static symbol isn't exported from C++ module?
In C only static symbols aren't exported. What about C++?
[ cat ver.cpp ]
static const unsigned major = 0;
static const unsigned minor = 9;
static const unsigned build = 1;
const unsigned version = (major << 24) | (minor << 16) | build;
[ ver.s ]
.file "ver.cpp"
.ident "GCC: (GNU) 4.0.0 20050305 (prerelease) (PLD Linux)"
.section .note.GNU-stack,"",@progbits
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20426