Re: getting copilation error with gcc 3.4.2
From: Keith Thompson (kst-u_at_mib.org)
Date: 02/22/05
- Next message: Eric Sosman: "Re: FAQ 4.9 and void**"
- Previous message: Keith Thompson: "Re: Is this board a good alternative to the PC?"
- Maybe in reply to: Eric Sosman: "Re: getting copilation error with gcc 3.4.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 22 Feb 2005 22:08:52 GMT
"Ashay" <saurabh_verma78@yahoo.com> writes:
> I am getting compilation error "error: parse error before
> "__extension__"" for following line of 'C' code:
>
> extern char *strchr(const char *s, int c);
> ("I had to put this line for some other reasons")
>
> I am using gcc 3.4.2. And, this error is coming only with '-O' option.
> With '-g', it is compiling.
>
> Can somebody please help me out.
I presume the ("I had to put this line for some other reasons") is
your comments, and doesn't appear in the source.
Probably strchr is defined as a function-like macro whose definition
uses some non-standard extension called "__extension__".
The way to get the declaration for strchr() is "#include <string.h>".
Why do you need to declare it yourself?
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.
- Next message: Eric Sosman: "Re: FAQ 4.9 and void**"
- Previous message: Keith Thompson: "Re: Is this board a good alternative to the PC?"
- Maybe in reply to: Eric Sosman: "Re: getting copilation error with gcc 3.4.2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|