Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use coccinell to detect wrong code patterns in CI/CD #3732

Open
masatake opened this issue May 24, 2023 · 1 comment
Open

Use coccinell to detect wrong code patterns in CI/CD #3732

masatake opened this issue May 24, 2023 · 1 comment

Comments

@masatake
Copy link
Member

https://www.kernel.org/doc/html/v4.18/dev-tools/coccinelle.html

An example of wrong code patter was reported in 8fffa20

@b4n
Copy link
Member

b4n commented May 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants