[bind10-dev] nullptr

Francis Dupont fdupont at isc.org
Fri Aug 31 09:21:22 UTC 2012


> On Thu, Aug 30, 2012 at 08:50:50PM +0000, Francis Dupont wrote:
> > in the last C++ specs the infamous NULL macro was replaced by
> > the nullptr keyword. IMHO it is far better but I don't know
> > if it is supported by all compilers even it is by g++ and MSVC.
> > Should we plan a nullptr campaign?

> How new version of g++ knows the new standard?

=> requires -std setting and recent g++ (>= 4.6)

> clang

=> more advanced than g++

> about sunstudio?

=> don't know, according to boost config it is no supported.

=> BTW for MSVC it is supported for >= VC++ 2010 (same than stdint.h :-)

> What about compilers we don't officially support

=> there are two answers:
 - http://wiki.apache.org/stdcxx/C%2B%2B0xCompilerSupport
  (nice as there are other C++0x/C++11 features like closures)
 - bind10 relies on other packages as boost, botan, gtest, etc.
  Googling for nullptr someone gives the advince to do the same thing
  than boost (good idea even it doesn't apply to nullptr). BTW we
  already got a portability problem with gtest (incompatible with
  the new VC++ 2012 RC, cf the WIN32-NOTES of trac2117 or
  http://code.google.com/p/googletest/issues/detail?id=412

> get Bind10 running on some embedded
> hardware in future, or new architecture?

=> I don't buy this: it is unlikely to see a new C++ compiler and
more unlikely to see a new one based on obsolete standards.

> I think nullptr really is too small motivation

=> I disagree about the coding style: NULL is pure C style (*) so
a dedicated keyword makes code far far cleaner. Now what about
backward compatibility, i.e., just define nullptr as NULL
for old compilers (e.g., sunstudio)?

(BTW in C NULL is ((void *)0) when it is 0 (or 0L) on C++,
this is enough to show the divorce between C and C++ about NULL)

Regards

Francis Dupont <fdupont at isc.org>


More information about the bind10-dev mailing list