🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #778

Re: SHORT, USHORT, and other absurdities

#778
From: Barr3y Jaspan
Date: Sun, 23 Aug 1992 22:23
21 lines
1374 bytes
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
Technical Details
Message-ID: <1992Aug23.222331.10456@athena.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!mintaka.lcs.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!bjaspan
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>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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