Re: NULL in include/RefCount.h?

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 16 Feb 2011 22:46:27 +1300

On 16/02/11 04:17, Kinkie wrote:
> Hi all,
> RefCount is a pure c++ artifact, and at least on my Ubuntu system it
> breaks the build. On the hudson nodes this doesn't seem to happen,
> probably due to indirect include from<iostream>.

 From stdio.h is that route most likely then. Or any number of other
system includes which define it.

> How to deal with it? Should we use the c++ "0" construct or try to
> define the NULL symbol somehow?
>

Alex brought removal up a while ago. My arguments about portability have
since been proven obsolete (yay).

So we are left with the opinions (me, Robert, Henrik IIRC) that use of
NULL makes it absolutely clear that the thing being tested is a pointer
and not an integer, no C++ magic conversion mistakes.

If need be we can add this to compat/compat_shared.h:
  #if !defined(NULL)
  #define NULL ((void*)0)
  #endif

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.11
   Beta testers wanted for 3.2.0.5
Received on Wed Feb 16 2011 - 09:46:32 MST

This archive was generated by hypermail 2.2.0 : Wed Feb 16 2011 - 12:00:06 MST