Bug 58338 - gcc-3.1-0.17 can't build 2.4.18-pre3-ac2 because it misparses valid code
Summary: gcc-3.1-0.17 can't build 2.4.18-pre3-ac2 because it misparses valid code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc3
Version: 1.0
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-01-14 17:37 UTC by Jonathan Kamens
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-01-14 18:27:16 UTC
Embargoed:


Attachments (Terms of Use)

Description Jonathan Kamens 2002-01-14 17:37:00 UTC
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 18:27:10 UTC
See http://gcc.gnu.org/ml/gcc-patches/2002-01/msg00956.html

Comment 2 Jakub Jelinek 2002-01-30 10:37:13 UTC
Fixed in gcc-3.1-0.18.


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