FreeBSD c++ and nullptr

Hi All,

Wondering if someone could offer some suggestions..

I am trying to port some software from Linux to FreeBSD. The software is a mix of C and C++, but mostly C++ and uses boost heavily.

When using the base clang compiler of FreeBSD it tries to always promote null to nullptr, which is giving me no end of headaches. If i install the gcc compiler from ports/packages the compiler does not give me all the grief.

This apparently is well known behavior for the clang compiler on FreeBSD (promoting null to nullptr) - is there a way to turn off that behavior in the base clang compiler on FreeBSD?
 
Hi All,

Wondering if someone could offer some suggestions..

I am trying to port some software from Linux to FreeBSD. The software is a mix of C and C++, but mostly C++ and uses boost heavily.

When using the base clang compiler of FreeBSD it tries to always promote null to nullptr, which is giving me no end of headaches. If i install the gcc compiler from ports/packages the compiler does not give me all the grief.

This apparently is well known behavior for the clang compiler on FreeBSD (promoting null to nullptr) - is there a way to turn off that behavior in the base clang compiler on FreeBSD?

My suggestion is to redefine NULL at a strategic place in your code:
C++:
#undef NULL
#define NULL 0
 
I will try that thank you - I think I meant to post this over in userland dev on this forum, I am sure a moderator will be cranky at me - please move the thread :)
 
Hi All,

Wondering if someone could offer some suggestions..

I am trying to port some software from Linux to FreeBSD. The software is a mix of C and C++, but mostly C++ and uses boost heavily.

When using the base clang compiler of FreeBSD it tries to always promote null to nullptr, which is giving me no end of headaches. If i install the gcc compiler from ports/packages the compiler does not give me all the grief.

This apparently is well known behavior for the clang compiler on FreeBSD (promoting null to nullptr) - is there a way to turn off that behavior in the base clang compiler on FreeBSD?
For example?
 
Back
Top