From: Charles Krug 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.