parse error

J

John Hanley

I just received a "parse error at end of input" when compiling my code, but
am unsure why. It lists the line as the very last line of my .c file "}"My
code compiled fine yesterday, and I only made some minor adjustments today.

I am using the DJGPP compiler.

Is this parse error indicative of anything particular?

Ideas?

Thanks again!

John
 
M

Mark A. Odell

I just received a "parse error at end of input" when compiling my code,
but am unsure why. It lists the line as the very last line of my .c
file "}"My code compiled fine yesterday, and I only made some minor
adjustments today.

I am using the DJGPP compiler.

Is this parse error indicative of anything particular?

Ideas?

Sure, give us something to look at (we can't read minds) or start "cutting
out" large chunks of the file with #if / #endif until the error goes away.
Then move back out until you find the problem. Of course you need to be
smart about placement of the if/endif directives.
 
B

Ben Pfaff

John Hanley said:
I just received a "parse error at end of input" when compiling my code, but
am unsure why. It lists the line as the very last line of my .c file "}"My
code compiled fine yesterday, and I only made some minor adjustments today.

This may indicate that you began more blocks with { than you
closed with }.
 
J

John Hanley

Some times it happends that one may add a { and not close it} like that

I found the problem. It makes sense that it was a parse error because it
was one "}" short. However, it was somewhere in the middle of my code, not
at the end. The error message really threw me off. But that's ok. At
least I found the problem.

Thanks for the help!

John
 
D

Darrell Grainger

I just received a "parse error at end of input" when compiling my code, but
am unsure why. It lists the line as the very last line of my .c file "}"My
code compiled fine yesterday, and I only made some minor adjustments today.

I am using the DJGPP compiler.

Is this parse error indicative of anything particular?

Ideas?

It is usually a missing } or ; that causes this. The compiler will line up
the braces incorrectly because one is missing but it will not realize the
problem until it gets to the end of the translation unit. It is sort of
like doing up the buttons on a shirt. If you miss a button hole you don't
realize it until you get to the bottom and find the last button does not
line up with the last button hole.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,372
Latest member
LucretiaFo

Latest Threads

Top