use C::Check 'check_functions'; # File::Slurper etc. my $c = read_text ('file.c'); check_functions ($c); e.g. calloc arguments in wrong order, uses gets, insists on comments at switch fallthroughs, optionally complains about using assert, etc.
C compilers typically don't warn about daft mistakes like putting function arguments in the wrong order, or using the wrong size of a variable, or things like not checking the return value of malloc, etc. This module would check for typical errors in C programs like switch fallthroughs, use of equals instead of == in an if statement, insist on using braces with if statements, bad if statement indentation, like
if (x) printf ("reached"); printf ("reached even if x is not true, despite this indentation");
At the moment I have a script which does something like the above, wondering whether it would be worth working up into a module.