Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!granite.pa.dec.com!mwm From: mwm@raven.pa.dec.com (Mike (Real Amigas have keyboard garages) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Prototypes... (Was: Excruciatingly simple programming question...) Message-ID: Date: 3 Aug 90 21:28:54 GMT References: <2667@mindlink.UUCP> <115524@linus.mitre.org> <1343@metaphor.Metaphor.COM> Sender: news@wrl.dec.com (News) Organization: Missionaria Phonibalonica Lines: 40 In-Reply-To: djh@neuromancer.metaphor.com's message of 2 Aug 90 18:20:32 GMT In article <1343@metaphor.Metaphor.COM> djh@neuromancer.metaphor.com (Dallas J. Hodgson) writes: In article <115524@linus.mitre.org> duncant@mbunix.mitre.org (Thomson) writes: >Oops, I just realized that in my last posting on this subject, I >forgot that |Read() and Write() are not stdio functions, but amiga >functions. But the same argument follows if the file which >contained prototypes for Read() and Write() had been included. No, no, no! The purpose of include files is to specify the way arguments OUGHTTA look, not to COERCE them into something. How would you catch any lint warnings if, for example, you past a short to an amiga lib function expecting a 32-bit pointer? Wrong answer - just slightly. The purpose of prototypes is to say what the arguments ought to look like, and where reasonable, coerce them into the right type. A function call consists of of a bunch of assignments; they act just like assignments, including coercions. If the coercions are "wrong" - i.e, any integral type (whether 16 or 32 bits) to any pointer type, or a long into a short - you should get a warning, even if the compiler generates code to do the "right" thing. The purpose of include files is to keep you from having to re-enter the same code over & over & over & over again. They also allow for some runtime type checking. Don't bash something you don't know anything about. Manx is (and ever was) a fine product. Must be - it generates some very fanatical defenders. I've twice seen them trying to redefine the C langage to be what Manx compiled, instead of vice versa.