Re:Learn C in Y Minutes
by flohofwoe on Tuesday April 13, 2021 @07:01AM
(#26790596)
This is also bad advice for C:
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.
[ Parent
| on HN ]
-Wstrict-prototypes
"Warn if a function is declared or defined without specifying the argument types."
This isn't the case nowadays.
Huh? Of course it is:
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.