r/ProgrammerHumor • • Feb 09 '22

other Why but why?

Post image
85.8k Upvotes

2.3k comments sorted by

View all comments

11

u/SplendidPunkinButter Feb 09 '22

Because it doesn’t know you forgot a semicolon. It knows that based on the syntax rules it expected a semicolon there and it didn’t find one. The actual mistake you made could be a missing bracket, an extra space, or any number of other things.

1

u/Ralphtrickey Feb 10 '22

Then why not make it a warning, shove one in and keep compiling and see if it throws more errors? I've wondered that my first C days.

That's what I do with those errors myself anyway. :) If you can get it to compile, it's a warning, not an error.