delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/18/12:49:32

From: Charles Krug <charles AT pentek DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Why does sizeof give me...
Date: Mon, 18 Aug 1997 09:17:26 +0100
Lines: 21
Message-ID: <33F80516.446A@pentek.com>
References: <97Aug13.151644gmt+0100 DOT 17061 AT internet01 DOT amc DOT de> <33F68612 DOT 5EF83660 AT alcyone DOT com>
NNTP-Posting-Host: mail.pentek.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Erik Max Francis wrote:

> 
> Yes, which is pretty bizarre.  Strangely enough, though, the guaranteed
> limitations on int short long are that short will be at least 16 _bits_
> and long will be at least 32 _bits_, independent of the number of bits in
> a char (ANSI C 5.2.4.2).  Note also that you can't have architectures with
> _less_ than 8 bits from ANSI C.
> 

I'm working with TI's family of floating point DSPs (xc30, xc40).  One
reason for the performance is that all the data is the same size--chars,
ints, longs, singles, doubles, are all 32-bit.  Chars are stored in the
8 LSBs, sign extended to 32 bits, if necessary.  This means, of course
that additional work is required to ensure that any chars you wish to
display (admittedly, not a frequent problem) are in the displayable
range.  Some number to string conversions need to be rethought, for
example.

-- 
Charles Krug, Jr.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019