From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19632 invoked by alias); 26 May 2007 18:15:32 -0000 Received: (qmail 19621 invoked by uid 48); 26 May 2007 18:15:24 -0000 Date: Sat, 26 May 2007 18:15:00 -0000 Subject: [Bug c/32099] New: a constant value is said to be not constant X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "andrei dot kouznetsov at gmail 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-05/txt/msg02348.txt.bz2 when I'm trying to compile the program ============================ #include static double s = sin(0.0); int main(){ return 0; } ============================ with gcc t.c, the compiler produces the warnings t.c:3: warning: initializer element is not constant t.c:3: warning: (near initialization for ‘s’) t.c:3: warning: ‘s’ defined but not used I'm worried about the first warning, since sin(0) is constant gcc -v generates: ======================================= Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) -- Summary: a constant value is said to be not constant Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: andrei dot kouznetsov at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32099