Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: use of NULL Keywords: NULL zero 0 C Microsoft Message-ID: <3638@xyzzy.UUCP> Date: 24 Feb 89 21:56:06 GMT References: <973@optilink.UUCP> <9684@smoke.BRL.MIL> <20928@shemp.CS.UCLA.EDU> Organization: Data General, RTP NC. Lines: 19 > heather@SEAS.UCLA.EDU > Why doesn't the C standard > treat NULL or 0 (a static/constant NULL or 0, i.e. indicated at compile time) > passed to a function that has a pointer value in the function prototype > as a special case and do the cast implicitly? Good point. The answer is that the discussion has been about what happens when there is no prototype in scope. It happens as you suggest when there is, but when there isn't, there isn't enough information to do the cast correctly. If the type of the formal argument is unknown to the compiler, even if the compiler was aware of NULL as a keyword, it would not know which type of null pointer was wanted. This is crucial for some architectures, where pointers to (or of) different types have different storage requiremnts or formats. -- God made integers. All else is the work of man. --- Leopold Kronecker (1823-1891) -- Wayne Throop !mcnc!rti!xyzzy!throopw