Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC830713); site edai.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!ukc!edcaad!edee!edai!ok
From: ok@edai.UUCP (Richard O'Keefe)
Newsgroups: net.lang.c
Subject: Integer sizes; storage classes.
Message-ID: <4301@edai.UUCP>
Date: Thu, 14-Jun-84 16:15:32 EDT
Article-I.D.: edai.4301
Posted: Thu Jun 14 16:15:32 1984
Date-Received: Wed, 13-Jun-84 06:55:10 EDT
Organization: Art.Intelligence,Edin.Univ.
Lines: 30

G'day.
I've just come across a C compiler for M6809s, and was rather shocked
to find that its authors had decided to make

	char	=  8 bits
	short	=  8 bits
	int	=  8 bits
	long	= 16 bits

I thought I could rely on "int i = 1000;".
As I've said in an earlier message, my reading of K&R is that "int" has
to be big enough to hold the difference between the addresses of the
ends of the largest array the programmer is allowed to declare.
Whether you agree or not, this selection would seem to make it pointlessly
difficult to port C programs to/from other compilers.
What do other opinionated people think about this?

The compiler has a nice feature: there is a "readonly" storage class.
readonly declarations must be initialised, and the data are placed in
the text area.  Is this part of some new standard?  There should be a
distinction between "readonly int x = 1;" and "static readonly int x = 1;"
but that would seem to mess up the syntax (worth it).

Speaking of storage classes, I know that in some compilers I *can* say
	extern ;
	.... ....
	;
but there's a compiler for a 32-bit midi which generates bad loader
code for this.  Clearly a bug, but is the bug failure to spot my abuse
of the language, or bad code generation for a correct program?