The following code produces a compilation error on both clang (3.6.0) and gcc(4.9.2) (coliru link)
#include <stdio.h> void foo(void){ printf("lalala\n"); } int main(void) { foo(1, 2, 3, 4, 5, 6, 67); return 0; } While VS2013 (while being compiled with /TC /W4) only produces a warning
warning C4087: 'foo' : declared with 'void' parameter list ... 9 1
Is this a bug in VC or are clang and gcc being too harsh?
foo().it. Youritrefers to an error due tofoo(1, 2, 3, 4, 5, 6, 67);(which is certainty a problem). I am suggestion the warning is due tofoo(void).void foo()means the function takes an unspecified number of parameters (which is a leftover from pre-ANSI C).void foo(void)explicitly says it takes no parameters.