Skip to content

Conversation

zanaviska
Copy link
Contributor

@zanaviska zanaviska commented Jan 21, 2024

‘error’ may be used uninitialized.
We used to declare error uninitialized, pass it to LineFit as OUT parameter, hoping that every path will initialize error varible. But there is path, where error is kept uninitialized, so it is better to explicitly initialize it here

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

‘error’ may be used uninitialized
@zanaviska
Copy link
Contributor Author

There may be clang-tidy warning about reducing scope of the variable, but I decided that it goes outside of the change that I was trying to make, since I was just trying to get rid of console warning. If maintainers think, that I should reduce variable scope too, write here about it

@asmorkalov asmorkalov self-requested a review February 1, 2024 15:01
Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov merged commit 1739e96 into opencv:4.x Feb 1, 2024
This was referenced Feb 5, 2024
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

Successfully merging this pull request may close these issues.

2 participants