public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32099]  New: a constant value is said to be not constant
@ 2007-05-26 18:15 andrei dot kouznetsov at gmail dot com
  2007-05-26 18:27 ` [Bug c/32099] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: andrei dot kouznetsov at gmail dot com @ 2007-05-26 18:15 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

when I'm trying to compile the program
============================
#include <math.h>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-10  3:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-26 18:15 [Bug c/32099] New: a constant value is said to be not constant andrei dot kouznetsov at gmail dot com
2007-05-26 18:27 ` [Bug c/32099] " pinskia at gcc dot gnu dot org
2007-05-26 18:47 ` andrei dot kouznetsov at gmail dot com
2007-05-28 12:54 ` manu at gcc dot gnu dot org
2007-06-10  3:23 ` [Bug middle-end/32099] not constant folding sin pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).