Re: References for machines where NULL is not zero.
- From: Martin Ambuhl <mambuhl@xxxxxxxxxxxxx>
- Date: Fri, 07 Oct 2005 04:28:24 GMT
pm940@xxxxxxxxx wrote:
Hello.
I've been reading some past discussions on the NULL vs. zero. References are always made to systems or machienes that use values other than zero to represent the NULL pointer.
Although not a practice I follow, there are no doubt millions of lines of open source libraries and applications that do things like:
p = malloc(...); if (!p) fail.
Which is obviously a bad thing on non-zero NULL machines.
It is *not* "obviously a bad thing". The C standard guarantees this will work as the coder expected.
Can anybody provide specific examples of modern machines/systems be them embedded or supercomputer where NULL is not zero?
Since you are confused about what the implications might be, such a discussion would be counterproductive.
The standard says what the standard says and I don't want to debate it.
But you *should* learn what the standard says. Your "obviously a bad thing" line shows that you don't yet have a clue.
Rather, I want to find counter-examples to prove that the standard's language still relevant.
Why don't you read it first before trying to critique it? .
- References:
- References for machines where NULL is not zero.
- From: pm940
- References for machines where NULL is not zero.
- Prev by Date: Re: Problems with my little c-program
- Next by Date: Re: "Portability" contructs like UINT32 etc.
- Previous by thread: Re: References for machines where NULL is not zero.
- Next by thread: Re: References for machines where NULL is not zero.
- Index(es):
Relevant Pages
|