From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18445 invoked by alias); 14 Sep 2007 15:25:05 -0000 Received: (qmail 18219 invoked by uid 48); 14 Sep 2007 15:24:56 -0000 Date: Fri, 14 Sep 2007 15:25:00 -0000 Subject: [Bug c/33437] New: potentially valid construct rejected X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jbeulich at novell dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-09/txt/msg01214.txt.bz2 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