2 ms·
>(I didn't know that no-arg functions in C are implicitly variadic! That's bizarre. I would have expected modern compilers to disable that by default, but I can
by 0xffff2 9y ago
>(I didn't know that no-arg functions in C are implicitly variadic! That's bizarre. I would have expected modern compilers to disable that by default, but I can't get Clang to warn me about it even with -Wall.)
I didn't know that either. I wonder if `void bogus(void)` behaves any differently?
- kccqzy 9y agoYes it would behave differently. Putting void in the parenthesis tells the compiler the function accepts no arguments at all.
- 0xffff2 9y agoGood to know. I never bothered with `void` inside the argument list in C before (I primarily write C++, very rarely C). I will have to remember to be more explicit when I do write C code in the future.
- Koshkin 9y agoYes, in C you must use 'void' to indicate that the function takes no arguments. (This is deprecated in C++ in favor to an empty argument list - which breaks backward compatibility with C).
- aidenn0 9y agoIt's not variadic, it's unspecified arguments. The compiler ought to complain if two function calls are made with conflicting argument types.