3 ms·
This is also bad advice for C: void function_1(); Most people coming from other languages (like C++) will probably think that this is identical with "void
by flohofwoe 6y ago
This is also bad advice for C:
void function_1();
Most people coming from other languages (like C++) will probably think that this is identical with "void function_1(void)", but without the explicit void argument list, the compiler will not warn if the function is accidentally called with parameters.
- okl 6y ago-Wstrict-prototypes "Warn if a function is declared or defined without specifying the argument types."
- junon 6y agoThis isn't the case nowadays.
- flohofwoe 6y agoHuh? Of course it is: https://godbolt.org/z/8qYeK89rh https://godbolt.org/z/8qYeK89rh It's only an error in C++, but not in C, and the warning for this isn't included in the usual "-Wall -Wextra" set.