Article View: comp.sys.amiga.tech
Article #4684Prototypes... (Was: Excruciatingly simple programming question...)
From: Mike (Real Amigas have keyboard ...
Date: Fri, 03 Aug 1990 21:28
Date: Fri, 03 Aug 1990 21:28
40 lines
2482 bytes
2482 bytes
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. <mike -- I went down to the hiring fair, Mike Meyer For to sell my labor. mwm@relay.pa.dec.com I noticed a maid in the very next row, decwrl!mwm I hoped she'd be my neighbor.
Technical Details
Message-ID:
<MWM.90Aug3162854@raven.pa.dec.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!granite.pa.dec.com!mwmReferences:
<2667@mindlink.UUCP> <115524@linus.mitre.org> <1343@metaphor.Metaphor.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <MWM.90Aug3162854@raven.pa.dec.com> 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