Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!xanth!kremer From: kremer@cs.odu.edu (Lloyd Kremer) Newsgroups: comp.lang.c Subject: Re: Why does lint complain about this? Summary: don't depend on prototypes Message-ID: <8660@xanth.cs.odu.edu> Date: 27 Apr 89 15:12:24 GMT References: <75688@ti-csl.csc.ti.com> <1773@ubu.warwick.UUCP> Organization: Old Dominion University, Norfolk, Va. Lines: 25 In article <1773@ubu.warwick.UUCP> geoff@cs.warwick.ac.uk (Geoff Rimmer) writes: >How did people ever survive without function prototypes! :-) They coded correctly, casting function arguments when necessary. Prototypes are very helpful in error checking, but it is an unwise practice to *depend* on the compiler to do your casting for you. If a function call would need an explicit cast to work correctly in the absence of a prototype, then it should have an explicit cast. One of the more common errors of this type (pun intended) occurs frequently in UNIX exec calls: execl(path, arg0, arg1, arg2, 0); /* non-portable */ instead of execl(path, arg0, arg1, arg2, (char *)0); -- Lloyd Kremer Brooks Financial Systems ...!uunet!xanth!brooks!lloyd Have terminal...will hack!