Re:Hey, C Is a Functional Language Too
by slig on Friday November 02, 2012 @08:43AM
(#4732332)
Quick question: why does he do this?
I've programmed C while in school, but I don't remember ever seeing this and I'm not sure how to google it.
[ Parent
| on HN ]
It stops the compiler from complaining about unused variables:
http://stackoverflow.com/questions/8052091/void-cast-of-argc...
Why would you do this instead of declaring it as `int main(void)`?
I use clang with a -Wall and -Wextra, which will complain about all sorts of stuff I generally want to know about, including unused variables (I think gcc does the same?). For the rare cases where I actually want to leave a variable unused I do the above to make the warning go away.