10000 Fix accessing uninitialized member by safocl · Pull Request #177 · aewallin/opencamlib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix accessing uninitialized member #177

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

safocl
Copy link
@safocl safocl commented May 26, 2025

accessing to uninitialized member is undefined behavior (if member function setTolerance is not called).

if((p - *p1).norm() < tol) {

here member tol is erroneous value or indeterminate value

https://eel.is/c++draft/defns.undefined
https://eel.is/c++draft/basic.indet#2
https://eel.is/c++draft/dcl.init.general#1
https://eel.is/c++draft/dcl.init#general-12
https://eel.is/c++draft/dcl.init#general-7.1
https://eel.is/c++draft/class.base.init
https://eel.is/c++draft/class#base.init-example-6

simple example:
https://godbolt.org/z/7s1YEfqhG

please select one of the explicit initialization options for the class member

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.

1 participant
0