delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/24/11:04:45

Date: Tue, 24 Mar 1998 17:23:23 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: Peter Palotas <blizzar AT hem1 DOT passagen DOT se>, djgpp AT delorie DOT com,
djgpp-workers AT delorie DOT com
Subject: Re: NULL redefined! :(
In-Reply-To: <m0yHSrw-000S2qC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.980324171958.22871J-100000@is>
MIME-Version: 1.0

On Tue, 24 Mar 1998, Salvador Eduardo Tropea (SET) wrote:

> But perhaps we must investigate if the __null have some advantage and:
> 
> 1) Define NULL conditionally (no redefinition)
> 2) If not defined:
> a) Test the gcc version, if 2.8.0 define with __null
> b) if prior define with 0.

I think that the C header(s) which define NULL should do so only under 
"#ifndef __cplusplus".  It is safer to let C++ use its own definition 
throughout, and leave C at its usual definition.

The only thing that bothers me is the case of a C++ code that calls a C 
function and passes it NULL as one of its arguments.  Can somebody check 
what does the C function see in that case, and will it compare equal to 
the C's notion of NULL?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019