Bug 53740 - nonsense array initialization causes infinite number of errors
Summary: nonsense array initialization causes infinite number of errors
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc3   
(Show other bugs)
Version: 9
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-17 15:21 UTC by David Nečas
Modified: 2007-04-18 16:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 00:05:07 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description David Nečas 2001-09-17 15:21:49 UTC
Description of Problem:

   Initialization of array of doubles to pointers to nonexistent symbols
   and NULL causes gcc to get into infinite loop priniting the same error
   message again and again.


Version-Release number of selected component (if applicable):

   Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.0.1/specs
   Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --host=i386-redhat-linux
   Thread model: posix
   gcc version 3.0.1 20010724 (Red Hat Linux 7.1 3.0-5)


How Reproducible:

   Always.


Steps to Reproduce:
1. create file badarray.c with following content:

   double array[] = {
     &foo,
     (void*)0
   };
 
2. run

   gcc3 -c badarray.c


Actual Results:

   gcc prints on stderr:

   badarray.c:2: `foo' undeclared here (not in a function)
   badarray.c:2: initializer element is not constant
   badarray.c:2: (near initialization for `array[0]')
   badarray.c:4: incompatible types in initialization
   badarray.c:4: initializer element is not constant
   badarray.c:4: (near initialization for `array[1]')
   badarray.c:4: initializer element is not constant
   badarray.c:4: (near initialization for `array')
   badarray.c:4: initializer element is not constant
   badarray.c:4: (near initialization for `array')
   .....
   (last two lines repeated over and over)


Expected Results:

   Each error message is printed only once.


Additional Information:

Comment 1 Jakub Jelinek 2001-10-25 10:29:49 UTC
See http://gcc.gnu.org/ml/gcc-patches/2001-10/msg01300.html
for a fix.

Comment 2 Richard Henderson 2004-10-02 00:05:07 UTC
Fixed for gcc 3.2.


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