Bug 53740 - nonsense array initialization causes infinite number of errors
nonsense array initialization causes infinite number of errors
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-17 11:21 EDT by David Nečas
Modified: 2007-04-18 12:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-01 20:05:07 EDT
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 David Nečas 2001-09-17 11:21:49 EDT
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 06:29:49 EDT
See http://gcc.gnu.org/ml/gcc-patches/2001-10/msg01300.html
for a fix.
Comment 2 Richard Henderson 2004-10-01 20:05:07 EDT
Fixed for gcc 3.2.

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