This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

other/8927: Gcc give error for wrong line of C code.


>Number:         8927
>Category:       other
>Synopsis:       Gcc give error for wrong line of C code.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 13 08:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     gp@qnx.com
>Release:        unknown-1.0
>Organization:
>Environment:
Redhat Linux 7.3 on i586, gcc-3.3.
>Description:
With the following source, gcc complains of an error on lin 10, when the error is actually on line 6:

#include <stdio.h>

int main(int argc, char **argv)
{
        printf("Hi!\n");
asdfasdf



        return(0);
}

Gcc gives the following error:

    $ gcc hi.c
    hi.c: In function `main':
    hi.c:10: `asdfasdf' undeclared (first use in this function)
    hi.c:10: (Each undeclared identifier is reported only once
    hi.c:10: for each function it appears in.)
    hi.c:10: parse error before "return"
>How-To-Repeat:
compile the above source with "gcc hi.c"
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]