2009/1/19, Nick Treleaven nick.treleaven@btinternet.com:
On Sun, 11 Jan 2009 02:40:58 -0500 "Daniel Richard G." skunk@iSKUNK.ORG wrote:
- Various cases of foo() --> foo(void). (Come on guys... the only excuse
is if you're older than dirt and still haven't broken your old K&R habits :)
Or you are used to C++ or C99 ;-) My brain keeps saying the 'void' is redundant. But I updated my function snippet a while ago to do it for me usually.
Here is little example why you should use void, the following code:
void foo() {} int main() { foo(1); return 0; }
will compile using gcc -Wall -Wextra without any warrning. If you add void you will get:
a.c: In function 'main': a.c:10: error: too many arguments to function 'foo'
Best regards, Yura Siamashka