[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: not enough real programmers? (was Re: Byte Magazine: 18 Vintage issues, 1985-1986)
dhansen@btree.com (Dave Hansen) writes:
> On Thu, 19 Aug 1999 18:58:00 GMT, seebs@plethora.net (Peter Seebach)
> wrote:
>
> >In article <WnYu3.1310$pC1.95872@cac1.rdr.news.psi.ca>,
> >Spehro Pefhany <speff@interlog.com> wrote:
> >>In comp.arch.embedded Peter Seebach <seebs@plethora.net> wrote:
> >>> But that's not all! Each type must be able to represent a certain range
> >>> of values. For 'short', that range is +/- 32,767. For 'int', it is also
> >>> +/- 32,767. For 'long', it is +/- 2,147,483,647, and you can't do that
> >>> without 32 bits.
...
> >Can't speak for C++, but for C, I think it's in Translation Limits.
> I can't speak for C89, but the latest C9x draft I have (n869) lists
> them in Numerical Limits, Sizes of Integer Types, �5.2.4.1
I can...
"
<CODE>char</CODE> a single byte, capable of holding one character in
the local character set. [1]
<CODE>int</CODE> an integer, typically reflecting the natural size
of integers on the host machine"
...
"The intent is that <CODE>short</CODE> and <CODE>long</CODE> should
provide different lengths of integer when practical; <CODE>int</CODE>
will normally be the natural size for a particular
machine. ... subject only to the restriction that <CODE>short</CODE>s
and <CODE>int</CODE>s are at least 16 bits, <CODE>long</CODE>s are at
least 32 bits, and <CODE>short</CODE> is no longer that
<CODE>int</CODE>, which is not longer that <CODE>long</CODE>."
That is from the "book" part of the K&R, the "standard" appendix says
the same but with different/clumsier words... In both cases, the
importand part is "at least". Nobody says that eg. in alpha
environment everything from char to long can't be 64 bits...[2]
(And I belive it's also mentioned somewhere that char fits to int, ie.
int is at least as long as a char. Which, of course usually(?) makes
sense because int is min 16 bits and there are not too many char sets
that are more that 16 bits... After all, C "standard" was not supposed
to define a language somebody should implement but describe an ad hoc
language that already existed. Or something.)
Also, note that many requirements of the modern C language are _not_
part of the _language_ ANSI standard but defined by POSIX
standard(s).
--karri
[1] Note: nobody's saying the "local character set" is _not_ w_char
ie. 16 bits
[2] ??RAM manufacturers would like that...
--
You have moved your mouse, for these : Karri Kalpio
changes to take effect you must shut : karri@moremagic.com
down and restart your computer. Do you : [+358] (9) 7017131 (home)
want to restart your computer now? : [+358] (9) 43543665 (work)