-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 #3204
Comments
Please submit a PR. |
As it came out in the review, I think I should elaborate on the first reported issue. There were 4 issues reported in the same loop: 450: void function returns value if (p == end || *p != '}')
return handler.on_error("unknown format specifier"); // #450
} else { 479: void function returns value } else {
return handler.on_error("missing '}' in format string"); // #479
} 371: void function returns value ++p;
if (p == end) return handler.on_error("invalid format string"); // #371
if (static_cast<char>(*p) == '}') { 414: void function returns value if (*begin != '{' && !find<IS_CONSTEXPR>(begin, end, '{', p))
return write(begin, end); // #414
write(begin, p); |
I don't think |
Hello,
We are using fmt as part of spdlog in one of the projects I am working on. Running Klocwork for static analysis against the project's code, several issues are reported in the library. Although many reported cases are false positives, some of them I believe are fixable. I have also checked and most reported issues are related to code that is not available in the newest version of the spdlog (version 1.11.0) and fmt.
Please check the list below.
include/spdlog/fmt/bundled/format.h:2448 | operator()()
Code: VOIDRET | Severity: Error (2) | State: Existing | Status: Analyze | Taxonomy: C and C++ | Owner: unowned
Fix:
specs_setter
defines a copy constructor, but no assignment operatorinclude/spdlog/fmt/bundled/format.h:1944 | format.h()
Code: CWARN.COPY.NOASSIGN | Severity: Review (4) | State: Existing | Status: Analyze | Taxonomy: C and C++ | Owner: unowned
Fix – removal:
dynamic_specs_handler
defines a copy constructor, but no assignment operatorinclude/spdlog/fmt/bundled/format.h:2174 | format.h()
Code: CWARN.COPY.NOASSIGN | Severity: Review (4) | State: Existing | Status: Analyze | Taxonomy: C and C++ | Owner: unowned
Fix – removal:
error_handler
defines a copy constructor, but no assignment operatorinclude/spdlog/fmt/bundled/core.h:407 | core.h()
Code: CWARN.COPY.NOASSIGN | Severity: Review (4) | State: Existing | Status: Analyze | Taxonomy: C and C++ | Owner: unowned
Fix – removal:
Please, share your opinion with me.
The text was updated successfully, but these errors were encountered: