Path: utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!news.crl.dec.com!decvax.dec.com!zinn!siia!drd From: drd@siia.mv.com (David Dick) Newsgroups: comp.os.minix Subject: Re: stdio.h : NULL Message-ID: <1990Oct25.170403.17449@siia.mv.com> Date: 25 Oct 90 17:04:03 GMT References: <32108@nigel.ee.udel.edu> Organization: Software Innovations, Inc. Lines: 22 In <32108@nigel.ee.udel.edu> UPSYF173%DBIUNI11.BITNET@cunyvm.cuny.edu (Wolfgang Thiel) writes: > Hi, > #ifdef NULL > #undef NULL > #endif > ... > #define NULL 0 >This really is bad!! It took me more than 2 hours with mdb to find out why >the program crashed. Of course, my machine's pointer size is not >sizeof int. Doesn't #define NULL ((void *)0) do the job an any machine? >Or do I miss something? > Wolfgang Thiel First, "void *" is not available on all machines. Second, 0 is legal C for "null pointer" in *all* cases except when a pointer is passed as an argument to a function. If this is not true for a particular compiler, the compiler is broken. David Dick Software Innovations, Inc. [the Software Moving Company (sm)]