home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / arch / 8891 < prev    next >
Encoding:
Text File  |  1992-08-13  |  2.1 KB  |  63 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!orca!javelin.sim.es.com!moons!jsnow
  3. From: jsnow@moons.sim.es.com (John Snow)
  4. Subject: Re: 32 => 64 Transition
  5. Message-ID: <jsnow.713740135@moons>
  6. Sender: news@javelin.sim.es.com
  7. Nntp-Posting-Host: moonsgw.sim.es.com
  8. Organization: Evans & Sutherland Computer Corporation
  9. References: <1992Aug08.165832.114442@cs.cmu.edu> <1992Aug11.125326.16719@email.tuwien.ac.at> <id.UHAS.9TA@ferranti.com> <1992Aug13.182851.18305@mprgate.mpr.ca>
  10. Date: Thu, 13 Aug 1992 21:08:55 GMT
  11. Lines: 50
  12.  
  13. mcvey@mpr.ca (Iain McVey) writes:
  14.  
  15. >Hmm, perhaps I have my wires crossed here, but I thought that int was
  16. >supposed to be processor defined, and that tiny, short and long were
  17. >of standard size.  ie.
  18.  
  19. >        16 bit    32 bit    64 bit
  20. >tiny        8    8    8
  21. >short        16    16    16
  22. >long        32    32    32
  23. >long long    (64)    (64)    64
  24.  
  25. >int        16    32    64
  26.  
  27. >with pointers implementation dependent.
  28.  
  29. >no?
  30.  
  31. >- Iain -
  32. >-- 
  33. >Iain McVey (mcvey@mpr.ca)    | Kodachrome, gives us those nice, bright colours,
  34. >Software Designer            | Gives the greens of summers,
  35. >MPR Teltech Ltd.             | Makes you think all the world's a sunny day.
  36. >8999 Nelson Way, Burnaby, BC | - Paul Simon
  37.  
  38.  
  39. According to Harbison & Steele's "C: A Reference Manual":
  40.  
  41.   "The type int may not be shorter than short and long may not be
  42. shorter int."                                     ---------------
  43. -----------
  44.  
  45.   "A good rule of thumb is that long is the largest supported integer
  46. size, while int is the largest efficient integer size. If efficiency
  47. is much more important that portability, then the int type may be the
  48. better one to use."
  49.  
  50. They go on to say that if portability is a goal, then it is best to
  51. define your own data types like INT64, INT32, INT16, INT8. These type
  52. definitions could reside in hardware specific .h files. Only this .h
  53. file needs to change for each hardware implementation and the rest of
  54. the source code stays the same.
  55.  
  56. --John
  57.  
  58. --
  59. -----------------------------------------------------------------------------
  60. John F. Snow                         INET:           jsnow@moons.sim.es.com
  61. Evans & Sutherland Computer Corp.    
  62. Salt Lake City, Utah                 America Online: JohnSnow  GEnie: J.SNOW2
  63.