home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!mintaka.lcs.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!bjaspan
- From: bjaspan@athena.mit.edu (Barr3y Jaspan)
- Newsgroups: comp.os.os2.programmer
- Subject: Re: SHORT, USHORT, and other absurdities
- Message-ID: <1992Aug23.222331.10456@athena.mit.edu>
- Date: 23 Aug 92 22:23:31 GMT
- 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>
- Sender: news@athena.mit.edu (News system)
- Organization: Massachusetts Institute of Technology
- Lines: 21
- Nntp-Posting-Host: portnoy.mit.edu
-
- roelofs@pan.arc.nasa.gov (Greg Roelofs) writes:
- >But what will you do on a machine where shorts are 64 bits by default,
- >but can be 24 or 46 bits via a compiler switch?
-
- This is certainly why they did it. Unfortunately, their solution is really
- stupid. It isn't at all clear to me that SHORT is defined to be a certain
- number of bits, when short isn't.
-
- A better solution would have been typedefs such as
-
- typedef char int8
- typedef unsigned char uint8
- typedef short int16
- typedef unsigned short uint16
-
- and so forth. Then, you can use "intxx" to get a certain number of bits, and
- always be SURE what you are getting, and those typedefs can get set correctly
- for any given architecture.
-
- --
- Barr3y Jaspan, bjaspan@mit.edu
-