Modernizing Fedora's C code
Modernizing Fedora's C code
Posted Nov 4, 2022 22:34 UTC (Fri) by floppus (guest, #137245)In reply to: Modernizing Fedora's C code by dskoll
Parent article: Modernizing Fedora's C code
For static functions, the function definition can tell you the parameter types. It's not uncommon in older codebases for static functions to always be defined before they're used, and not to have prototypes (I think K&R C doesn't allow forward declarations of static functions at all.) External functions, of course, usually have prototypes in a header file, guarded by #ifdef __STDC__ or something.
GCC doesn't check argument types against an earlier old-style definition (though it does check old-style parameters against an earlier prototype), and -Wmissing-prototypes doesn't complain about missing prototypes for static functions, either.