I'm confused (Re: What C compilers have non-zero null pointers?)

john c chu chu at acsu.buffalo.edu
Tue Jul 17 05:44:12 AEST 1990


In article <9007161750.AA00664 at edison.CHO.GE.COM> rja <rja at edison.cho.ge.com> writes:
>I used to use a compiler for MSDOS and the 80x86 cpus 
>whose NULL pointer was F000:0000 hex when examined via
>a debugger.  It of course did compile fine as long as one
>used sense and compared pointers to NULL rather than 
>a constant of zero...

I thought NULL was a macro defined to be 0 or (void *)0
so that it didn't matter what the computer itself uses for a "null"
pointer, C would always use 0 and making it whatever it's suppose to
be to fit the computer was the compiler's job.

Anyway, I thought comparing a pointer to NULL was the same as
comparing a pointer to (a properly cast) zero.

Am I way off base?

					john
				chu at autarch.acsu.buffalo.edu

(When is the next time the FAQ list gets posted? I have a feeling most
of my questions are probably answered there.)



More information about the Comp.lang.c mailing list