home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4399 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  1.3 KB

  1. Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!bjaspan
  2. From: bjaspan@athena.mit.edu (Barr3y Jaspan)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: SHORT, USHORT, and other absurdities
  5. Message-ID: <1992Aug23.222331.10456@athena.mit.edu>
  6. Date: 23 Aug 92 22:23:31 GMT
  7. References: <19920811.003756.988@almaden.ibm.com> <910@nazgul.UUCP> <qr+nf3a.feustel@netcom.com> <1992Aug23.044105.8994@riacs.edu> <harris.714594213@garfield.catt.ncsu.edu>
  8. Sender: news@athena.mit.edu (News system)
  9. Organization: Massachusetts Institute of Technology
  10. Lines: 21
  11. Nntp-Posting-Host: portnoy.mit.edu
  12.  
  13. roelofs@pan.arc.nasa.gov (Greg Roelofs) writes:
  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?
  16.  
  17. This is certainly why they did it.  Unfortunately, their solution is really
  18. stupid.  It isn't at all clear to me that SHORT is defined to be a certain
  19. number of bits, when short isn't.
  20.  
  21. A better solution would have been typedefs such as
  22.  
  23. typedef char int8
  24. typedef unsigned char uint8
  25. typedef short int16
  26. typedef unsigned short uint16
  27.  
  28. and so forth.  Then, you can use "intxx" to get a certain number of bits, and
  29. always be SURE what you are getting, and those typedefs can get set correctly
  30. for any given architecture.
  31.  
  32. -- 
  33. Barr3y Jaspan, bjaspan@mit.edu
  34.