Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Problems with malloc() Message-ID: <1991Apr04.024405.29127@ima.isc.com> Date: 4 Apr 91 02:44:05 GMT References: <1991Apr1.171908.2198@cs.mcgill.ca> <1991Apr1.232358.18938@milton.u.washington.edu> Sender: usenet@ima.isc.com Reply-To: karl@ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 15 In article <1991Apr1.232358.18938@milton.u.washington.edu> jinx@milton.u.washington.edu (Everyone Knows JINX) writes: >Did you prototype your functions? If you didn't, you might have to >explicitly cast msgalloc() to Message *. This is incorrect advice. If the (non-int) function isn't declared (whether by prototype or by Classic C declaration is irrelevant), then the program is wrong, and no amount of casting will make it right. Non-int% functions *must* be explicitly declared& before use. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint ________ % Even int-valued functions *should* be, but for historical reasons the language doesn't require it. & The best way to declare a function is to include the header file associated with it, if any.