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

Remove unnecessary null pointer checks #857

Open
elfring opened this issue Oct 30, 2021 · 6 comments
Open

Remove unnecessary null pointer checks #857

elfring opened this issue Oct 30, 2021 · 6 comments

Comments

@elfring
Copy link

elfring commented Oct 30, 2021

Extra null pointer checks are not needed in functions like the following.

@juangpc
Copy link
Collaborator

juangpc commented Nov 1, 2021

All these are very good catches. Thanks. Would you be willing to PR the changes?

@elfring
Copy link
Author

elfring commented Nov 1, 2021

💭 Would you become interested to use a development tool like “clang-tidy” for corresponding source code adjustments?


How do you think about to adjust any more source code places? 🤔

@juangpc
Copy link
Collaborator

juangpc commented Nov 1, 2021

Yes, we use it.
As shown in different places here https://mne-cpp.github.io/pages/development/contribute.html, we use qtcreator for development and that brings clang-tidy by default. But we have an unsurmountable amount of warnings. So I guess the ones you are mentioning are probably there... We keep addressing them frequently, although not frequently enough.

@elfring
Copy link
Author

elfring commented Nov 1, 2021

How do you think about to improve the software situation any more by influencing evolution according to development tools for automatic source code adjustments? 🤔

@juangpc
Copy link
Collaborator

juangpc commented Nov 1, 2021

That's a good idea. But I think that the chances of a fix generating more harm than good are, in my opinion too high. Our testing pipeline, or our coverage, aren't in great either. So it would mean that it would be hard to catch the generated problem.
Bear in mind that some of our libraries inherit from c libraries which implement a particular way of managing memory. This means that these components live a long way from raii.

@elfring
Copy link
Author

elfring commented Nov 1, 2021

Search patterns can be specified for questionable source code places.
They can become more sophisticated on demand, can't they? 🤔

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

No branches or pull requests

2 participants