Hacker News new | ask | show | jobs
by OskarS 2552 days ago
Isn't that pretty much the definition of a warning? An expression that is technically valid, but probably a mistake. If something wasn't a valid expression, it would be a compiler error, not a warning.
1 comments

Usually, yes. C is weird because undefined behavior is illegal, can sometimes be detected statically, and yet will not produce an error. So sometimes you get warnings for invalid yet error-free code. It’s a strange language.