This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc: why is "abcdef"[3] not a constant (error: initializer element is not constant)
- From: m-h-l <markus dot lehmann at intel dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 11 May 2015 01:28:07 -0700 (MST)
- Subject: Re: gcc: why is "abcdef"[3] not a constant (error: initializer element is not constant)
- Authentication-results: sourceware.org; auth=none
- References: <1431076943221-1146945 dot post at n5 dot nabble dot com> <554C98A4 dot 8030404 at redhat dot com> <1431086743832-1146998 dot post at n5 dot nabble dot com> <554CB581 dot 4070906 at redhat dot com> <1431092064434-1147037 dot post at n5 dot nabble dot com> <554CD3F6 dot 7000409 at redhat dot com> <554D36DA dot 8010704 at gmail dot com>
Hi GonzÃlez,
thanks for the hint with switch/case. I tried it and it fails in my
environment, too.
So it seems not to be recommended to make such a construct, even not with
g++.
A run-time solution for this is not possible for me because some of the
created data sections will not be part of the final code and so cannot be
modified at run-time.
Cheers
--
View this message in context: http://gcc.1065356.n5.nabble.com/gcc-why-is-abcdef-3-not-a-constant-error-initializer-element-is-not-constant-tp1146945p1147794.html
Sent from the gcc - Help mailing list archive at Nabble.com.