-
Notifications
You must be signed in to change notification settings - Fork 355
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
fix: static analysis problems #785
Conversation
* fix to warrnings reported by Klocwork in CLI11 v2.2.0
@@ -750,7 +750,7 @@ class AsNumberWithUnit : public Validator { | |||
|
|||
// transform function | |||
func_ = [mapping, opts](std::string &input) -> std::string { | |||
Number num; | |||
Number num{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is necessary, but it's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this is just a cosmetic change. I just wanted to hold the tool back from moaning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's just a cosmetic change, I'd have no problem with it. I think it might zero initialize some types, which is technically wasteful, the will only be written to. But in the scope of parsing CLI code, it's totally acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. That was my take also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely understand your point of view
Codecov ReportBase: 99.29% // Head: 99.29% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #785 +/- ##
=======================================
Coverage 99.29% 99.29%
=======================================
Files 16 16
Lines 3973 3974 +1
=======================================
+ Hits 3945 3946 +1
Misses 28 28
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
fixes #784 - warnings reported by Klocwork in CLI11 v2.2.0