Newsgroups: comp.sys.amiga.tech
Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!decwrl!bacchus.pa.dec.com!granite.pa.dec.com!mwm
From: mwm@raven.pa.dec.com (Mike (Real Amigas have keyboard garages) Meyer)
Subject: Prototypes... (Was: Excruciatingly simple programming question...)
In-Reply-To: djh@neuromancer.metaphor.com's message of 2 Aug 90 18:20:32 GMT
Message-ID: <MWM.90Aug3162854@raven.pa.dec.com>
Sender: news@wrl.dec.com (News)
Organization: Missionaria Phonibalonica
References: <2667@mindlink.UUCP> <115524@linus.mitre.org>
	<1343@metaphor.Metaphor.COM>
Date: 3 Aug 90 16:28:54
Lines: 40

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.
