home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!rbg.informatik.th-darmstadt.de!misar
- From: misar@rbg.informatik.th-darmstadt.de (Walter Misar)
- Subject: Re: Exact-sized types (was Re: Typedefing builtin... thanks.)
- Sender: news@news.th-darmstadt.de (The News System)
- Message-ID: <1993Jan6.202221@rbg.informatik.th-darmstadt.de>
- Date: Wed, 6 Jan 1993 19:22:21 GMT
- References: <1992Nov30.204147.7955@cimage.com> <84931@ut-emx.uucp> <F9I0BER@math.fu-berlin.de>
- Nntp-Posting-Host: rbhp58.rbg.informatik.th-darmstadt.de
- Organization: TH Darmstadt
- Lines: 25
-
- In article <F9I0BER@math.fu-berlin.de>, rene@hamel.uucp (Rene Mueller) writes:
- > In article <84931@ut-emx.uucp>, jamshid@ut-emx.uucp (Jamshid Afshar) writes:
- > |> I don't understand the purpose of the "at-least-N-bits" types. C
- > |> already has those -- char (>=8), short (>=16), int (>=16), and long
- > |> (>=32). What does your extra level of indirection buy you?
- > You are'nt correct:
- > int is as long as a single machine word on the machine (on some machines this
- > means 12bit), on this machines also a short is 12bit long and a long is 24bits
- > long...
- > The same is with characters
- > Some compilers will give you only the original ASCII-Characterset and a
- > char-value with this machines is 7bit long, all other bits stored in memory
- > for this value will be ignored...
-
- Nope, he is correct. I don't know exactly about chars, but ints and shorts
- have to have at least 16 bit (on a binary machine this is, the definition
- was, that both must be able to hold all numbers n with -32768<n< +32768).
- Similar with longs: they have to be at least 32 bits. Int should have a
- size of a 'natural word' on a given machine, but if this proves to be to small,
- an int has to be constructed out of several words.
-
- --
- Walter Misar | It is impossible to enjoy
- misar@rbg.informatik.th-darmstadt.de | idling thoroughly unless
- | one has plenty of work to do.
-