lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] 'NULL' versus '0'


From: Greg Chicares
Subject: [lmi] 'NULL' versus '0'
Date: Wed, 25 Oct 2006 14:22:43 +0000
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)

My 'style' document makes no mention of 'NULL' (yet). I've
always used '0' instead, following Stroustrup:

http://www.research.att.com/~bs/bs_faq2.html#null

However, he has changed his thinking:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf

and I would accept 'nullptr' if you want to add

  #if APPROPRIATE_CONDITION
  #   define nullptr 0
  #endif // APPROPRIATE_CONDITION

to all three 'config_*.hpp' files. (I don't know where
gcc and comeau stand, but for borland I fear the only
appropriate condition is '#if 1'.)

[I think a 'nullptr' macro is better than the other options
in BS's paper, but tell me if you disagree.]

I'd also accept '0'. But if you make the above change, then
I would welcome (but not ask) you to replace such use of
'0' globally--and then we'd have a new guideline that I'd
ask everyone including me to follow thenceforth.

But I still would prefer that we avoid 'NULL', except in
the few third-party files that we've copied but see no
point in modifying.

May I ask you to choose a guideline for the project and
change your code to follow it? Anything but 'NULL'....





reply via email to

[Prev in Thread] Current Thread [Next in Thread]