ctags icon indicating copy to clipboard operation
ctags copied to clipboard

Use coccinell to detect wrong code patterns in CI/CD

Open masatake opened this issue 1 year ago • 1 comments

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

masatake avatar May 24 '23 18:05 masatake

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.

b4n avatar May 25 '23 07:05 b4n