Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/23/84; site ucbcad.UUCP Path: utzoo!linus!decvax!ucbvax!ucbcad!tom From: tom@ucbcad.UUCP Newsgroups: net.lang.c Subject: Re: ANSII C, optimization, and "hardware registers" Message-ID: <2747@ucbcad.UUCP> Date: Wed, 17-Oct-84 17:06:47 EDT Article-I.D.: ucbcad.2747 Posted: Wed Oct 17 17:06:47 1984 Date-Received: Fri, 19-Oct-84 05:38:49 EDT References: <1538@wateng.UUCP> Organization: UC Berkeley CAD Group, Berkeley, CA Lines: 21 I ran into some similar problems when I was writing a device driver. I had to put in some weird kludges to make things work. MOST of my problems could be solved by avoiding the optimizer, but not all. In any case, I wanted to use the optimizer to tighten the code as much as I could. I concluded that there should be a storage class that indicates hardware side-effects. I also thought it would be nice to have storage attributes for read-only registers (I guess this is the "const" storage class in the proposed ANSI standard -- I don't think much of the mnemonic value here, but I suppose consistency is more important than mnemonics) and one for write-only registers, so you would get a compile-time error if you tried to read a write-only register or vice versa. I'm sure there are other strange storage classes/attributes that people would like to see in the standard. What do people think is a reasonable set? I personally think the side-effect class is very important (IS this in the proposed standard? I don't remember seeing it, but I may be senile.), but the others are harder to justify. Tom Laidig