Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!shamash!tank!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: use of NULL Message-ID: <225800136@uxe.cso.uiuc.edu> Date: 23 Feb 89 16:06:00 GMT References: <965@optilink.UUCP> Lines: 36 Nf-ID: #R:optilink.UUCP:965:uxe.cso.uiuc.edu:225800136:000:1011 Nf-From: uxe.cso.uiuc.edu!mcdonald Feb 23 10:06:00 1989 Subject is the flame wars resulting from the never-ending NULL (presumable pointer) affairs. Chris Torek claims (correctly) that if one wishes to pass a null pointer to a subroutine, that if you cast it to the proper type, it will work: sub((char *)0); /* pass a character pointer*/ subd((double *)0); /* pass a pointer to double */ I ask: Is it not possible to do away with this if one uses functions prototypes? Is this correct (I mean, ABSOLUTELY correct?) void sub(char *); void subd(double *); sub(0); subd(0); void sub(char * xchar) { ... } void sub(double *ddouble) { ... } I ask this as a question, not as a proposition of a flame. I have written a lot of programs for mixed (VERY mixed) model programs on the PC, and used strict prototypes for all. They seem to work fine. I never cast anything in arguments, unless it is a signed to unsigned (or vice-versa) conversion, and in that case I am paranoid enough to write out each step explicitly. Am I doing a no-no? Doug McDonald