TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: All
from: Bruce Partridge
date: 2003-11-17 14:27:46
subject: RE: [C] word sizes

From: Bruce Partridge 

I work on embedded systems.  The chip I am programming now is brand new,
and my C gives me a 16 bit long.  Embedded systems are a bit of a special
case, but C is very popular for embedded programmers.

Bruce Partridge
http://www.rebreather.ca

-----Original Message-----
From: c-bounces{at}snippets.org [mailto:c-bounces{at}snippets.org]On Behalf Of
Pascal.Schmidt!1.153.401.2{at}filegate.net
Sent: Monday, November 17, 2003 3:01 PM To: c{at}snippets.org
Subject: Re: [C] word sizes


Hi Bob! :-)

 BS> I have, OTOH, heard of a couple of architectures where you
 BS> couldn't necessarily count on shorts being 16 bits or longs being 32
 BS> bits. Ints, of course, are all over the map. Fortunately, the days of
 BS> those architectures are, like the days of one's complement math,
 BS> mostly history.
Ahem, gcc on 64 bit machines uses a model where longs are 64 bits (LP64, longs
and pointers are 64 bit, int is 32 bit). On 32 bit machines, it uses the ILP32
model; meaning int, long, and pointers are 32 bits.

Or did you mean a long could be less than 32 bits on some old oddball machine?

 BS> Excellent point - but, as you point out, not explicitly stated nor
 BS> immediately obvious.
Even if a char were represented as, say, 64 bits, the actual value could always
be 255 or less, with EOF being represented by a value greater than 255.

Ciao
Pascal

-+- Msged/LNX 6.1.1
 + Origin: Many are cold, but few are frozen. (1:153/401.2)
_______________________________________________
C mailing list
C{at}snippets.org
http://www.snippets.org/mailman/listinfo/c
Gateway to the FidoNet C_Echo
-+-
Incoming mail is certified Virus Free. Checked by AVG anti-virus system
(http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release
Date: 11/10/2003

-+-
Outgoing mail is certified Virus Free. Checked by AVG anti-virus system
(http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release
Date: 11/10/2003

--- BBBS/LiI v4.01 Flag-5
* Origin: Prism bbs (1:261/38)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.