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

Static analysis issues #10

Closed
cschol opened this issue Aug 17, 2023 · 3 comments
Closed

Static analysis issues #10

cschol opened this issue Aug 17, 2023 · 3 comments

Comments

@cschol
Copy link

cschol commented Aug 17, 2023

We are now running static analysis tools CodeQL and cppcheck during the integration process and the following issues were found:

Running cppcheck analysis...
src/colors.hpp:97:44: error: Signed integer overflow for expression '255<<24'. [integerOverflow]
    return r | (g << 8) | (b << 16) | (255 << 24);
                                           ^
src/text.cpp:22:28: error: va_list 'args' was opened but not closed by va_end(). [va_end_missing]
    return r < 0 ? "??" : s;
                           ^

Please take look and see if these need to be adressed.

@Paul-Dempsey
Copy link
Owner

Paul-Dempsey commented Aug 17, 2023

Good diagnostics :-)

If you're going to be running these during integration, it would helpful to document for plugin developers how we can do the same, with the same configuration ( e.g. CodeQL db). Otherwise, I can't verify that any code changes I made actually pass the analysis and we'll just have to iterate in issues which is a burden on you.

Best if this is integrated into the Rack SDK.

@cschol
Copy link
Author

cschol commented Aug 18, 2023

It won't be integrated in the Rack SDK. It could be integrated in the VCV Rack Plugin Toolchain at some point, but for now I will run it manually during integration. CodeQL is the standard out-of-the-box configuration for for cpp.

cppcheck is invoked like this:

cppcheck src/ -isrc/dep --std=c++11 -j 8 -q --error-exitcode=1

@Paul-Dempsey
Copy link
Owner

Thanks a lot for the info - helpful!

Fixed: 7497e83

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