home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!kaufman
- From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
- Subject: Re: short/long ints (was Re: Sozobon C...)
- Message-ID: <kaufman.726252466@Xenon.Stanford.EDU>
- Sender: news@CSD-NewsHost.Stanford.EDU
- Reply-To: kaufman@CS.Stanford.EDU
- Organization: CS Department, Stanford University, California, USA
- References: <29848@castle.ed.ac.uk> <3917@isgtec.isgtec.com> <C0AKGC.IsJ@news.cso.uiuc.edu> <1993Jan4.202040.26524@reed.edu> <1993Jan5.174802.13028@waikato.ac.nz>
- Date: 5 Jan 93 16:47:46 GMT
- Lines: 24
-
- ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
-
- >In article <1993Jan4.202040.26524@reed.edu>, bowman@reed.edu (BoBolicious) writes:
- ->
- -> I *guess* you could talk about a "Mac int standard", but what's really going
- -> on is that Pascal uses 16-bit ints. Most C compilers these days use 32-bit
- -> ints. Personally, I think ints are stupid to use, because of this uncertainty
- -> as to what is meant; far better to specifically use shorts & longs.
-
- >Back when I used to program voluntarily in Fortran, I developed this convention
- >that I would explicitly use INTEGER*2 or INTEGER*4 wherever it mattered, and
- >just use INTEGER wherever it didn't. This way my code could compile with
- >either the /I4 (INTEGER = INTEGER*4) or /NOI4 (INTEGER = INTEGER*2) switch,
- >and so long as I used the same switch setting with all my modules, the final
- >program would run OK.
-
- On machines with multiple compilers, this can come back to bite you. I
- recently moved part of a Windows DLL to 32-bit mode, and of course used a
- 32 bit compiler for that part. Unfortunately the shared structures had
- elements of type "integer".
-
- --
- Marc Kaufman (kaufman@CS.Stanford.EDU)
-
-