replaced 0 with NULL for null pointers (best practice for C)#7244
replaced 0 with NULL for null pointers (best practice for C)#7244MichaelChirico merged 3 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7244 +/- ##
=======================================
Coverage 98.79% 98.79%
=======================================
Files 81 81
Lines 15254 15254
=======================================
Hits 15070 15070
Misses 184 184 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No obvious timing issues in HEAD=replace0withNULL Generated via commit d9f3f84 Download link for the artifact containing the test results: ↓ atime-results.zip
|
|
Could you please provide a reference for this |
|
A reference for the fact that I'm not sure where I would look for the specific guideline that specifies this, but |
|
in that case I am uncommonly ignorant :) |
|
Gustedt even advocates against NULL (and for C23 nullptr), but that
depends on the context (this isn't a variadic function call) and we're
not C23 yet:
https://inria.hal.science/hal-02383654v1/preview/ModernC.pdf#page=149
|
|
I'm not familiar with this document, but I do know that NULL is used elsewhere is the code. I still affirm my belief that using It would seem hard to believe that It specifies behavior and intent, while |
|
In fact the Google Guide recommends https://google.github.io/styleguide/cppguide.html#0_and_nullptr/NULL |
|
Yeah, that's not available in c99 |
|
I'm happy with this SO Q&A as a reference: https://stackoverflow.com/a/1296865/3576984 Gemini also pointed me to: https://www.mathworks.com/help/bugfinder/ref/misrac2012rule11.9.html
|

No description provided.