ctags
ctags copied to clipboard
Use coccinell to detect wrong code patterns in CI/CD
https://www.kernel.org/doc/html/v4.18/dev-tools/coccinelle.html
An example of wrong code patter was reported in https://github.com/universal-ctags/ctags/pull/3690/commits/8fffa2066a828cf9fa950a719f116718b84a9d96
A quick look didn't make me understand how we'd use this, but if it is able to catch calls with improper types, that'd be awesome indeed :)
There are probably more tricky cases like this (where there is a cast making things look explicit and good, but the cast is actually wrong), or even worse this (where the incorrect cast is valid, implicit, and doubly indirect (through a variable and intermediate function calls)), that I'm not sure any tool would be able to catch though… even a compiler plugin would require not only check the call, but the whole call chain to figure out there's a char
to int
cast in the value at some level.