home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20687 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.7 KB  |  37 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!kaufman
  3. From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
  4. Subject: Re: short/long ints (was Re: Sozobon C...)
  5. Message-ID: <kaufman.726252466@Xenon.Stanford.EDU>
  6. Sender: news@CSD-NewsHost.Stanford.EDU
  7. Reply-To: kaufman@CS.Stanford.EDU
  8. Organization: CS Department, Stanford University, California, USA
  9. 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>
  10. Date:  5 Jan 93 16:47:46 GMT
  11. Lines: 24
  12.  
  13. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  14.  
  15. >In article <1993Jan4.202040.26524@reed.edu>, bowman@reed.edu (BoBolicious) writes:
  16. ->
  17. -> I *guess* you could talk about a "Mac int standard", but what's really going
  18. -> on is that Pascal uses 16-bit ints.  Most C compilers these days use 32-bit
  19. -> ints.  Personally, I think ints are stupid to use, because of this uncertainty
  20. -> as to what is meant; far better to specifically use shorts & longs.
  21.  
  22. >Back when I used to program voluntarily in Fortran, I developed this convention
  23. >that I would explicitly use INTEGER*2 or INTEGER*4 wherever it mattered, and
  24. >just use INTEGER wherever it didn't. This way my code could compile with
  25. >either the /I4 (INTEGER = INTEGER*4) or /NOI4 (INTEGER = INTEGER*2) switch,
  26. >and so long as I used the same switch setting with all my modules, the final
  27. >program would run OK.
  28.  
  29. On machines with multiple compilers, this can come back to bite you.  I
  30. recently moved part of a Windows DLL to 32-bit mode, and of course used a
  31. 32 bit compiler for that part.  Unfortunately the shared structures had
  32. elements of type "integer".
  33.  
  34. -- 
  35. Marc Kaufman (kaufman@CS.Stanford.EDU)
  36.  
  37.