home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4398 < prev    next >
Encoding:
Text File  |  1992-08-23  |  1.7 KB  |  35 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!gatech!taco!garfield.catt.ncsu.edu!harris
  3. From: harris@garfield.catt.ncsu.edu (Michael Harris)
  4. Subject: Re: SHORT, USHORT, and other absurdities
  5. Message-ID: <harris.714594213@garfield.catt.ncsu.edu>
  6. Sender: news@ncsu.edu (USENET News System)
  7. Organization: North Carolina State University
  8. References: <19920811.003756.988@almaden.ibm.com> <910@nazgul.UUCP> <qr+nf3a.feustel@netcom.com> <1992Aug23.044105.8994@riacs.edu>
  9. Date: Sun, 23 Aug 1992 18:23:33 GMT
  10. Lines: 23
  11.  
  12. roelofs@pan.arc.nasa.gov (Greg Roelofs) writes:
  13.  
  14. >But what will you do on a machine where shorts are 64 bits by default,
  15. >but can be 24 or 46 bits via a compiler switch?  Likewise for 64-bit
  16. >floats and 128-bit doubles?
  17.  
  18. Ahhhhh! This guy's got it.  As I understand it, MS & IBM defined SHORT,
  19. USHORT, LONG, ULONG, et. al. to guarantee the size of your variables.
  20.  
  21. I think it is GUARANTEED that USHORT is always defined as 16 bits and ULONG is
  22. alway defined as 32 bits where int and double can be different bit sizes
  23. depending upon the operating system and the compiler.
  24.  
  25. In MS or IBM C, I think that int is a 16 bit value where in DEC's Ultrix, int
  26. is a 32 bit value. I'm not sure what AIX uses, but I would assume (again, this
  27. is an assumption) that int is a 32 bit value. Also, I assume that IBM's
  28. compiler with AIX has defined in it SHORT and USHORT as 16 bit values and
  29. LONG and ULONG as 32 bit values.  (The last part is just supposition.)
  30.  
  31. ______________________________________________________________________________
  32.      Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
  33.  System Administrator, Computer & Technologies Theme Program, NC State Univ.
  34. (My opinions are my own and do not represent those of NCSU or IBM Corporation)
  35.