Bug 117486 - gcc incorrectly finds error in simple routine
gcc incorrectly finds error in simple routine
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2004-03-04 10:34 EST by Joe Harrington
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-03-04 10:45:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joe Harrington 2004-03-04 10:34:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114 Galeon/1.3.11a

Description of problem:
The following file is good C, and compiles without errors under gcc32
and gcc296 in the FC1 release:

int finc(void){
return 1;

gcc 3.3.2 give this error:

% gcc -c finc.c
finc.c: In function `finc':
finc.c:2: error: syntax error before "return"

% gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

Adding an unused variable fixes it:

int finc(void){
int a;
return 1;

This compiles without errors.  However, replacing the "int" line with
a blank line gives the same error as before.

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

How reproducible:

Steps to Reproduce:
1. cat > finc.c <<EOF
int finc(void){
return 1;

2. gcc -c finc.c


Actual Results:  inc.c: In function `finc':
finc.c:2: error: syntax error before "return"

Expected Results:  compiled to finc.o without errors or other messages

Additional info:

gcc32 -c finc.c
gcc296 -c finc.c
both work

I'm rating this high because it breaks lots of existing code. 
Standard packages (e.g., HDF library) won't compile, etc.

Comment 1 Jakub Jelinek 2004-03-04 10:45:40 EST
Sorry, works for me just fine (tried gcc 3.3.2-1, 3.3.2-8).
Comment 2 Joe Harrington 2004-03-04 12:02:59 EST
Interesting.  I just tried it on 2 other machines, and it works.  It
still fails on the first machine, even when I cut and paste out of my
bug report.  But, these three machines have identical FC1 installs,
and both do nightly updates with yum.  The gcc binaries are the same
size and date, though prelinking has changed their md5sums.
All report:

% /usr/bin/gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

% rpm -q gcc

Clearly there is a problem, but I have no idea what it could be.  Do you?

Comment 3 Joe Harrington 2004-03-24 16:23:24 EST
The problem has been traced to a hardware issue that inserts bit
errors into files.


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