[cfe-dev] Fixing selector types on the GNU runtime

Mike Stump mrs at apple.com
Tue Jan 20 17:35:08 PST 2009


On Jan 20, 2009, at 4:51 PM, David Chisnall wrote:
> I can't find a copy of the spec online (and I leant my paper copy to  
> someone a while ago), but every reference I can find says that NULL  
> may be a #define for 0 or 0L.

Fine, but this is irrelevant to the question at hand.  The question at  
hand is an internal implementation detail of a particular compiler,  
that compiler being g++ on FreeBSD.  They apparently goofed.  That's a  
bug in FreeBSD, and it needs to be fixed.  Once fixed, there is no  
issue here.

> If NULL is #define'd to __null on some platforms, then this is  
> great, but isn't it a GCC extension?

I'd call it a private internal implementation detail of the compiler.   
The compiler is implemented such that for proper operation, NULL  
_must_ be __null.

>  I was under the impression that the LLVM coding conventions stated  
> that GCC extensions were to be avoided so that it could be easily  
> portable to compilers.

llvm uses NULL.  NULL is not a gcc extension.



More information about the cfe-dev mailing list