"parse error before" bug

Randall R Schulz rrschulz@cris.com
Wed Jul 31 01:34:00 GMT 2002


Hi,

You named the source file "go.c" and invoked the compiler with "gcc," so 
your source code is being interpreted as C, not C++.

In C, all declarations must precede all executable lines within any given 
block.

Randall Schulz
Mountain View, CA USA


At 19:49 2002-07-30, =?BIG5?B?sWmr7a3X?= wrote:
>hi
>
>i'm compiling a small program go.c like:
>
>----------------------------------------------
>#include <stdio.h>
>int main(){
>         printf("parse error after this");
>         int a;
>}
>----------------------------------------------
>
>with the error below:
>
>----------------------------------------------
>$ gcc go.c -o go
>go.c: In function `main':
>go.c:4: parse error before `int'
>
>----------------------------------------------
>
>i found removing the line "printf(....);" turns to be OK then.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list