#428814 [powerpc] error: initializer element is not constant

Package:
gcc
Source:
gcc-defaults
Description:
GNU C compiler
Submitter:
Gerrit Pape
Date:
2024-10-31 17:45:08 UTC
Severity:
important
Tags:
#428814#5
Date:
2007-06-14 11:35:14 UTC
From:
To:
On a current Debian/powerpc sid system:

 $ cat >ttt.c <<EOT
 static const double d[] = { 1.0l/6/1/2, -1.0l/30/3/4 };
 int main() { return 0; }
 EOT
 $ gcc-4.1 ttt.c
 ttt.c:1: error: initializer element is not constant
 ttt.c:1: error: (near initialization for 'd[0]')
 ttt.c:1: error: initializer element is not constant
 ttt.c:1: error: (near initialization for 'd[1]')
 $ echo $?
 1
 $

It works just fine on other architectures, and indeed should work IMO.
It causes the dietlibc to FTBFS

http://buildd.debian.org/fetch.cgi?&pkg=dietlibc&ver=0.30-6&arch=powerpc&stamp=1178194051&file=log

Thanks, Gerrit.

#428814#10
Date:
2007-06-14 12:27:49 UTC
From:
To:
Gerrit Pape <pape@dbnbgs.smarden.org> writes:

This is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26374

#428814#19
Date:
2007-06-29 10:46:56 UTC
From:
To:
severity 428814 critical
quit

The dietlibc FTBFS because of this.

gcc-4.2 4.2-20070627-1 has the same problem, is there a workaround?

Thanks, Gerrit.

#428814#26
Date:
2007-06-30 09:24:15 UTC
From:
To:
severity 428814 important
thanks

no, it's not "critical".

Gerrit Pape writes:

make the initializer double precision for now?