🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4670

Re: Excruciatingly simple programming question...

#4670
From: Dallas J. Hodgson
Date: Thu, 02 Aug 1990 18:20
37 lines
2595 bytes
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.
>
>
>Duncan Thomson
>
>--
>(Please excuse the typos and garbage caused by line noise.)

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?

Manx's -l option is wonderful for catching these kind of problems if you
include its <functions.h> file. Compile it using 16-bit ints, then compile
it again using 32-bit ints. Every case where something should be long but
it's not will be identified. The -l stands for 'lint', by the way.

The reason for compiling both ways is because the size of an int may or may
not be the same size as a long, so you may or may not get a warning message.
If you refrain from using ints at all, (explicitly declare shorts & longs)
the only ints use have to worry about are integer constants.

Don't bash something you don't know anything about. Manx is (and ever was)
a fine product.
+----------------------------------------------------------------------------+
| Dallas J. Hodgson               |     "This here's the wattle,             |
| Metaphor Computer Systems       |      It's the emblem of our land.        |
| Mountain View, Ca.              |      You can put it in a bottle,         |
| USENET : djh@metaphor.com       |      You can hold it in your hand."      |
+============================================================================+
| "The views I express are my own, and not necessarily those of my employer" |
+----------------------------------------------------------------------------+
Technical Details
Message-ID: <1343@metaphor.Metaphor.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!metaphor!neuromancer!djh
References: <2667@mindlink.UUCP> <115524@linus.mitre.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!metaphor!neuromancer!djh
From: djh@neuromancer.metaphor.com (Dallas J. Hodgson)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Excruciatingly simple programming question...
Message-ID: <1343@metaphor.Metaphor.COM>
Date: 2 Aug 90 18:20:32 GMT
References: <2667@mindlink.UUCP> <115524@linus.mitre.org>
Sender: news@metaphor.Metaphor.COM
Reply-To: djh@neuromancer.metaphor.com (Dallas J. Hodgson)
Organization: Metaphor Computer Systems, Mountain View, CA
Lines: 37