Skip to content

kokke/tiny-lint-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-lint-c

A small and simple static analysis tool for C implemented in C

Description

A small "linter" for C written in C99, demonstrating shallow static analysis at the lexical level of abstraction.

There are currently five checks implemented:

  • A check for nullary function prototypes declared incorrectly, e.g. in the form of f() instead of f(void).
  • A check for variable names that have a misleading prefix, e.g. uint32_t u8var instead of uint32_t u32var.
  • A check for seemingly misplaced semi-colons after control statements (if, for, while), e.g. if (x); { ... }.
  • A check for assignments in expressions deciding control-flow (if, for, while), e.g. if (v = 0) { ... }.
  • A check for too many return-statements in a function (configurable limits on 'too many'), warning if a function can return from more than e.g. 3 places.

NOTE: This is very much a work in progress still. It should be fairly easy to hack on though.

About

A small and simple static analysis tool for C in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages