This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33437] New: potentially valid construct rejected
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Sep 2007 15:24:56 -0000
- Subject: [Bug c/33437] New: potentially valid construct rejected
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
extern char x[] __attribute__((__weak__));
int i = (long)x;
results in 'initializer element is not computable at load time'. However, the
compiler really can't know this, as x may be either zero (since it's weak) or
may be used as C-level place holder for an assembler/linker defined absolute
symbol. While emitting a warning here (that should have a control for
suppressing) seems appropriate, failing the compilation isn't - that decision
should be left to the assembler (in case the target doesn't have an
appropriately sized relocation type) or the linker.
--
Summary: potentially valid construct rejected
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33437