This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: NULL
- From: "Artem B. Bityuckiy" <mail_lists at mail dot ru>
- To: Ahmed Masud <masud at googgun dot com>, newlib at sources dot redhat dot com
- Date: Tue, 30 Sep 2003 18:42:25 +0400
- Subject: Re: NULL
- References: <3F7948EE.2030609@mail.ru> <3F7991AE.60107@googgun.com>
- Reply-to: mail_lists at mail dot ru
Ahmed Masud wrote:
Artem B. Bityuckiy wrote:
Hello
I've found than there is no "standard" place for NULL in Newlib. NULL
is defined in stdio.h, stdlib.h, locale.h, time.h, wchar.h and in a
variety of internal .c files. In all cases there are
#ifndef NULL
#define NULL
#endif
in these files. What is the reason of such many NULL definition? I
need NULL for internal use when I'm changing Newlib. And I've also
defined one more version of NULL. May be it is better to add NULL
definition to somewhere like sys/_types.h ?
May be desirable to actually put it in stdio.h; or in its own file
null.h. In addition NULL should be defined as:
#ifndef NULL
#define NULL ((void *)0)
#endif
Not as a blank.
Cheers,
Ahmed
Of course, NULL isn't the blank, I wanted to write
#ifndef NULL
#define NULL 0
#endif
NULL is defined in GCC's stddef.h.
Sorry for silly question.
Best Regards,
Artem