Bug 168871 - compile: syntax error before "typedef" in stddef.h
compile: syntax error before "typedef" in stddef.h
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-20 15:25 EDT by mcconnau
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-05 09:21:35 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)
tar -xjf diagnose.tgz2 and examine diagnose/contents (129.92 KB, multipart/tarball)
2005-09-21 15:02 EDT, mcconnau
no flags Details

  None (edit)
Description mcconnau 2005-09-20 15:25:24 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Description of problem:
In a large project I have been working on thru several versions of GNU-Linux, I got this compiler error, for the first time:
in file included from /usr/include/bits/types.h:31,
from /usr/include/unistd.h:186,
from (my header),
/usr/lib/gcc-lib/i386-redhat-linux/3.3.4/include/stddef.h:213: syntax error before "typedef"
lines 212 and 213 of stddef.h are
#if !(defined (__GNUG__) && defined(size_t))
typedef __SIZE_TYPE__ size_t;
I got it to compile by inserting between these a line consisting of a semicolon  and a comment.


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

How reproducible:
Always

Steps to Reproduce:
Have only seen it with the present version of my sources, on the fc3 system; have not investigated how to isolate the problem


Additional info:
Comment 1 Bill Nottingham 2005-09-20 15:27:59 EDT
Assigning to gcc, but I suspect something is odd with your sources or your C
compiler flags.

What's the full command line?
Comment 2 Jakub Jelinek 2005-09-20 15:31:53 EDT
Can you preprocess your source with -E -dD (in place of e.g. -c) gcc command line
option and attach here?  Thanks.
Comment 3 mcconnau 2005-09-21 15:02:17 EDT
Created attachment 119090 [details]
tar -xjf diagnose.tgz2      and examine diagnose/contents

Results from compiling my command.c with -E and -dD, with and without the hack
I did on stddef.h
Comment 4 Joachim Nilsson 2005-10-05 09:11:18 EDT
Hi, I had the exact same problem -- only on Debian unstable, testing(etch) and
Sarge (3.1).

Very odd situation.  

I ended up writing small-fine.c that only included stdio.h and printed some
text. Everything worked fine until I added the search path for my project
include files, BAM!  

It turned out I had an autogenerated file called features.h in there which
screwed up stuff badly.  After I had removed it I could build with all kinds of
GCC versions.

Note: I did not add any new #include to my small-fine.c, I just added
"-I../include" to my GCC command line!
Comment 5 Jakub Jelinek 2005-10-05 09:21:35 EDT
Sorry, missed your reply.
The bug is in the source you are compiling.
command.c starts with:
x/*
EXPERIX version 4.0, Copyright (C) 2004, 2005  William Bayard McConnaughey
is a command interface for process control and data analysis.
...
*/

Note the initial x.  So you end up with
x /* comments and whitespace */ typedef unsigned int size_t;
which is obviously not a valid C source.

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