On Sat, Jun 27, 2020 at 2:06 PM Richard Sandiford <richard.sandif...@arm.com> wrote: > > Ilya Leoshkevich via Gcc-patches <gcc-patches@gcc.gnu.org> writes: > > Bootstrapped and regtested on x86_64-redhat-linux, ppc64le-redhat-linux > > and s390x-redhat-linux. > > Agree we should do this FWIW, but as a belt-and-braces fix, would it > make sense to define NULL to nullptr in system.h for all hosts? > > Currently we have: > > /* Define a generic NULL if one hasn't already been defined. */ > #ifndef NULL > #define NULL 0 > #endif > > which we might be able to change to: > > #undef NULL > #define NULL nullptr > > The current position is probably too early though. I think it should > instead be after all system headers have been included, so that there's > no chance of a multiple definition error, and no risk that our definition > confuses the system headers.
Good idea, IMHO this should be done before this big patch (or we can even go without it to reduce backporting issues). > This of course relies on files sticking to the “don't include system > headers directly“ rule, and using INCLUDE_* macros instead. (Which > isn't pretty, but that's where we are…) Yeah. Richard. > Thanks, > Richard