Red Hat Bugzilla – Bug 168871
compile: syntax error before "typedef" in stddef.h
Last modified: 2007-11-30 17:11:13 EST
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 (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):
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
Assigning to gcc, but I suspect something is odd with your sources or your C
What's the full command line?
Can you preprocess your source with -E -dD (in place of e.g. -c) gcc command line
option and attach here? Thanks.
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
Hi, I had the exact same problem -- only on Debian unstable, testing(etch) and
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
Note: I did not add any new #include to my small-fine.c, I just added
"-I../include" to my GCC command line!
Sorry, missed your reply.
The bug is in the source you are compiling.
command.c starts with:
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.