Pascal not considered harmful - was Re: Rich kids are into COBOL
cisin at xenosoft.com
Sat Feb 21 11:07:08 CST 2015
Keep in mind, that K&R C is a C, not just "C like", without many of the
restrictions of ANSI C.
I actually agree with most of the ANSI CHANGES to C.
BUT, K&R C IS C, not "C like", in spite of not being "ANSI C"
On Sat, 21 Feb 2015, Sean Conner wrote:
> > >6-, 7-, and 8-bit character types as well as 18-bit and 36-bit
> > >integers would be useful, but by definition it wouldn't actually be C.
Some minor NITS:
> The constraints are:
> sizeof(short) <= sizeof(int)
> sizeof(int) <= sizeof(long)
> sizeof(short) < sizeof(long)
IIRC, K&R permitted sizeof(short) <= sizeof(long)
You COULD build a C with 32 bits for every type.
You COULD build a C with 16 bits for every type, but hopefully would not.
Memory was more limited in those days; IIRC, K&R warned against assuming
that sizeof(char*) == sizeof(int)
> unsigned short 0 .. 65,536
> unsigned int 0 .. 65,536
those should be 0 .. 65535
> And the minumum ranges are:
> signed short -32,767 .. 32,767
> signed int -32,767 .. 32,767
16 bit 2's complement goes from -32768 ... 32767
does the ANSI standard leave off the -32768?
(not objecting, just curious)
> signed long -2,147,483,647 .. 2,147,483,647
Grumpy Ol' Fred cisin at xenosoft.com
More information about the cctalk