Article View: comp.os.os2.programmer
Article #776Re: SHORT, USHORT, and other absurdities
From: Michael Harris
Date: Sun, 23 Aug 1992 18:23
Date: Sun, 23 Aug 1992 18:23
23 lines
1808 bytes
1808 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? Likewise for 64-bit
>floats and 128-bit doubles?
Ahhhhh! This guy's got it. As I understand it, MS & IBM defined SHORT,
USHORT, LONG, ULONG, et. al. to guarantee the size of your variables.
I think it is GUARANTEED that USHORT is always defined as 16 bits and ULONG is
alway defined as 32 bits where int and double can be different bit sizes
depending upon the operating system and the compiler.
In MS or IBM C, I think that int is a 16 bit value where in DEC's Ultrix, int
is a 32 bit value. I'm not sure what AIX uses, but I would assume (again, this
is an assumption) that int is a 32 bit value. Also, I assume that IBM's
compiler with AIX has defined in it SHORT and USHORT as 16 bit values and
LONG and ULONG as 32 bit values. (The last part is just supposition.)
______________________________________________________________________________
Michael Harris - harris@catt.ncsu.edu or harris@carvm3.vnet.ibm.com
System Administrator, Computer & Technologies Theme Program, NC State Univ.
(My opinions are my own and do not represent those of NCSU or IBM Corporation)
Technical Details
Message-ID:
<harris.714594213@garfield.catt.ncsu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!taco!garfield.catt.ncsu.edu!harrisReferences:
<19920811.003756.988@almaden.ibm.com> <910@nazgul.UUCP> <qr+nf3a.feustel@netcom.com> <1992Aug23.044105.8994@riacs.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!taco!garfield.catt.ncsu.edu!harris From: harris@garfield.catt.ncsu.edu (Michael Harris) Subject: Re: SHORT, USHORT, and other absurdities Message-ID: <harris.714594213@garfield.catt.ncsu.edu> Sender: news@ncsu.edu (USENET News System) Organization: North Carolina State University References: <19920811.003756.988@almaden.ibm.com> <910@nazgul.UUCP> <qr+nf3a.feustel@netcom.com> <1992Aug23.044105.8994@riacs.edu> Date: Sun, 23 Aug 1992 18:23:33 GMT Lines: 23