[cc65] NULL descrepency

From: Andrew J. Kroll <forge1dr.ea.ms>
Date: 2006-04-06 11:08:26
First the quote :-)


       WG14/N869   Committee Draft  --  January 18, 1999        287
 
 
       7.17  Common definitions <stddef.h>
<SNIP>
       [#3] The macros are

               NULL

       which expands  to  an  implementation-defined  null  pointer
       constant; and
<SNIP>


Now the problem...

in stddef.h (and a few other places) we have:

/* NULL pointer */
#ifndef _HAVE_NULL
#define NULL	0
#define _HAVE_NULL
#endif



This should actually be:

/* NULL pointer */
#ifndef NULL
#define NULL    (void *)0
#endif

This is true for the includes for GNU's headers, M$ C (every one I looked at),
Borland's C products, HI-TECH C, AZTEC C, MIX C, and every other
implementation I have seen. With that, I have made my point that the headers
are in error. Furthermore, I suggest each header be wrapped so they are
reentrant, this way you define things in ONE place and where they belong
and can be called upon from other headers when required. 

That also brings me to another point as far as the header files...

We have the cbm.h file which calls on the other CBM platforms, atari.h, apple,
and so on. Would it not make sense that if we have these particular headers
which grab OS dependencies, to point any header at the proper header, and if
you have them reentrantly wrapped with #ifdef _CC65_STDDEF_H_SEEN_ (example)
more code can compile out of the box. This makes total sense to me, and how
the many other cross compilers do it... with the pre-set cpp macros...
Why not follow suit?

Yours,
-- 
Andrew J. Kroll
Software and Hardware Engineer and Consultant
Grafixoft http://dr.ea.ms/HW/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Apr 6 11:08:35 2006

This archive was generated by hypermail 2.1.8 : 2006-04-06 11:08:38 CEST