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

Static analysis: dealii-git/source/multigrid/mg_level_global_transfer.cc #3423

Closed
bangerth opened this issue Nov 3, 2016 · 1 comment
Closed

Comments

@bangerth
Copy link
Member

bangerth commented Nov 3, 2016

dealii-git/source/multigrid/mg_level_global_transfer.cc	393	warn	V688 The 'copy_indices' local variable possesses the same name as one of the class members, which can result in a confusion.
dealii-git/source/multigrid/mg_level_global_transfer.cc	395	warn	V688 The 'copy_indices_global_mine' local variable possesses the same name as one of the class members, which can result in a confusion.
dealii-git/source/multigrid/mg_level_global_transfer.cc	397	warn	V688 The 'copy_indices_level_mine' local variable possesses the same name as one of the class members, which can result in a confusion.
dealii-git/source/multigrid/mg_level_global_transfer.cc	451	err	V758 The 'global_partitioner' reference becomes invalid when smart pointer returned by a function is destroyed.
dealii-git/source/multigrid/mg_level_global_transfer.cc	453	err	V758 The 'level_partitioner' reference becomes invalid when smart pointer returned by a function is destroyed.
dealii-git/source/multigrid/mg_level_global_transfer.cc	61	warn	V730 Not all members of a class are initialized inside the constructor. Consider inspecting: level, global_dof_index, level_dof_index.

We should address these warnings and errors from the static analysis tool PVS. In response to #3342.

@bangerth
Copy link
Member Author

bangerth commented Nov 5, 2016

The two warnings about global_partitioner and level_partitioner are not strictly wrong, but I'm going to choose not to fix them: we ask some long-lived object for a reference to one of its members that happens to be stored through a std::shared_ptr. The warning is that the reference will become stale if someone deletes the object in the middle, but this does not happen in the very narrow scope in which we keep the reference.

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

No branches or pull requests

1 participant