Bug 58338 - gcc-3.1-0.17 can't build 2.4.18-pre3-ac2 because it misparses valid code
gcc-3.1-0.17 can't build 2.4.18-pre3-ac2 because it misparses valid code
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc3 (Show other bugs)
1.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-01-14 12:37 EST by Jonathan Kamens
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-14 13:27:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2002-01-14 12:37:00 EST
jik:/tmp!88> cat foo.c
typedef struct
{
  int foo;
} foo_t;

#define CONST_FOO (foo_t) { 0 }

foo_t foo[5][5] = { [ 0 ... 4 ] = { [ 0 ... 4 ] = CONST_FOO } };
jik:/tmp!89> gcc -c foo.c
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0][0]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0][1]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0][2]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0][3]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0][4]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[0]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[1]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[2]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[3]')
foo.c:8: initializer element is not constant
foo.c:8: (near initialization for `foo[4]')
jik:/tmp!90> 

If you change the #define to "#define CONST_FOO { 0 }", it compiles.  It
compiles *without* that change with gcc 2.95.2.
Comment 1 Jakub Jelinek 2002-01-14 13:27:10 EST
See http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00956.html
Comment 2 Jakub Jelinek 2002-01-30 05:37:13 EST
Fixed in gcc-3.1-0.18.

Note You need to log in before you can comment on or make changes to this bug.