Re: References for machines where NULL is not zero.



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? .



Relevant Pages

  • Re: Serial communication and EOF?
    ... But if zero can also indicate EOF, it becomes impossible to detect the difference. ... is no precedence issue and the normal requirement for -1 with EAGAIN ... if I use selectbefore the readcall to check if the file descriptor is ready for reading? ...
    (comp.unix.programmer)
  • Re: Not knowing how to read the statistics
    ... How should I read the statistics below? ... reading it, depending on who is doing the reading and both ... or "Plus or minus point two five (one oh; or one zero) millimeters". ... between American usage and British usage on this. ...
    (sci.stat.math)
  • RE: Please HELP!!
    ... Well if I am reading ok, then your most useful, and adecuate ... I enter a sales figure for each department and each week. ... chart and a line chart set up with the range being the all department ... as zero and plotting all future weeks at zero, ...
    (microsoft.public.excel.misc)
  • Re: C++ Prob with Programming Exercise in a Book
    ... Take user input, display a cummulative total, and use ... >>zero to terminate the program. ... I thought that using a zero wouldnt be ... You're reading from the standard ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Splitting database
    ... I was reading the code just fine. ... > NOT a zero length string, ... >> If the table is NOT linked, then would it even be possible to relink? ...
    (microsoft.public.access.externaldata)