-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make NULL a nullptr var and deprecate it. #665
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
Conversation
|
Starting build on |
| #ifndef NULL | ||
| #define NULL 0 | ||
| constexpr const auto R__DEPRECATED(6,12, "Please #include <cstddef> instead of relying on ROOT's NULL") | ||
| NULL = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it would be better to either use #define NULL ((void*)0) to be compatible with C, or simply remove it from ROOT altogether and just #include <cstddef> to get it from the standard. I wonder what happens when one uses nullptr to call something from a C library. Won't things break? If not, then just including the standard header is probably the best solution. References: C and C++ versions of NULL.
|
The header will be compiled with C++. And this definition does what C++ is asking for, and allows us to sneak in an attribute. And btw, it's basically unused because +/- all code is getting |
|
Build failed on mac1012/native. Warnings:
Failing tests: |
|
Hm, if this is a fallback case why bother to deprecate it? |
|
I still don't see the advantage in deviating from the standard (i.e., either |
Let's see whether all implementations provide it as prescribed and simply remove it from ROOT (in a new PR). Once that works I'll close this one. |
|
Superseded by #668 |
No description provided.