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 #412

Closed
elfring opened this issue Mar 7, 2018 · 5 comments
Closed

Remove unnecessary null pointer checks #412

elfring opened this issue Mar 7, 2018 · 5 comments
Labels
Type: Maintenance Refactoring, cleanup, documenation, or process improvements

Comments

@elfring
Copy link

elfring commented Mar 7, 2018

An extra null pointer check is not needed in functions like the following.

How do you think about to apply a corresponding update suggestion which will eventually be generated by the software "Coccinelle"?

@Deletion@
expression x;
@@
-if (\(x != 0 \| x != NULL\))
    g_free(x);
@pastly
Copy link
Contributor

pastly commented Mar 7, 2018

If you have the time to open issues for trivial-to-fix non-issues, please also find the time to submit pull requests to solve them.

@elfring
Copy link
Author

elfring commented Mar 8, 2018

I find it unlikely at the moment that I am going to contribute pull requests for this software because I do not like specific properties of the corresponding licence.

@robgjansen
Copy link
Member

Thanks for pointing this out. We plan to remove glib as a dependency soon, in which case the NULL checks may become useful. We'll consider this as we clean up our code in future releases.

@elfring
Copy link
Author

elfring commented Mar 8, 2018

I suggest to consider additional development tools and software design approaches so that more unnecessary checks can be avoided.

@robgjansen robgjansen added Type: Maintenance Refactoring, cleanup, documenation, or process improvements and removed refactor labels Jun 3, 2020
@stevenengler
Copy link
Contributor

stevenengler commented Apr 26, 2023

Closing since we're moving from C to rust.

@stevenengler stevenengler closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Refactoring, cleanup, documenation, or process improvements
Projects
None yet
Development

No branches or pull requests

4 participants