Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 1999 13:07:20 -0700 (PDT)
From:      jin@george.lbl.gov
To:        nate@mt.sri.com
Cc:        freebsd-bugs@FreeBSD.ORG, sheldonh@uunet.co.za
Subject:   Re: 'sizeof' C storage (was Re: bin/14472: date for Y#K)
Message-ID:  <199910292007.NAA26819@george.lbl.gov>

next in thread | raw e-mail | index | archive | help
> > "long" seems to be a bad type definition in C program since it is not in
> > a fixed variable size. I will not use it at a critical segment.
> 
> No variable types are 'fixed' in C.  On Win32, int is 32 bits, on Alpha
> it's 64 bit.  The only thing you can rely on is that short <= int <=
> long.  The relative sizes are unknown, unless you limit your code to a
> certain hardware/software platform of known release.

Maybe this should be changed now to make short=2Byte, long=4Byte, and
int=register_size=pointer. We should not stay on something is bad, and
follow it.  Think about this -- if sizeof short == 4, most network code
will be broken, since the 16-bit is critical to the TCP/IP stack.

The new types, such as int16_t, int32_t, int##[#]_t, are in fixed sizes.
I am not sure this is a tendnecy or there is some group working on it
for new specification; but it seems that many compilers have such feature
built-in right now.

	-Jin



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910292007.NAA26819>