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

Uninitialized data member in test code #1444

Open
jwakely opened this issue Jul 9, 2024 · 0 comments
Open

Uninitialized data member in test code #1444

jwakely opened this issue Jul 9, 2024 · 0 comments
Assignees
Labels

Comments

@jwakely
Copy link
Contributor

jwakely commented Jul 9, 2024

https://github.com/oneapi-src/oneTBB/blob/1f52f5093ec7ce23829fe64ab82ac5541fea42ee/test/conformance/conformance_flowgraph.h#L335-L351

If I'm reading this correctly, the copy constructor does not initialize copies_count. That means if you make a copy of a copy, the new object will do ++other.copies_count; on an uninitialized variable.

Is there any reason not to initialize copies_count to zero here?

Using default member initializers for all four data members seems sensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants