Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: A different view of volatile Message-ID: <3642@haddock.ISC.COM> Date: 26 Apr 88 21:01:29 GMT References: <13074@brl-adm.ARPA> <2003@rtech.UUCP> <7996@pur-ee.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 28 In article <7996@pur-ee.UUCP> hankd@pur-ee.UUCP (Hank Dietz) writes: >Instead, why not use "register" to solve the [volatile] problem.... Currently, "break" has two (or maybe one and a half) meanings, "static" has two meanings, and "void" has three. I'd rather not see "register" achieve a similar overloading, which is what I see in your proposal. >[a register object cannot be volatile] But the converse is false. I use non-volatile non-register objects all the time. Also, your proposal breaks the rule of defaulting to the most common case. Most programs don't need *any* volatile declarations, and of those that do, most objects are *not* so qualified. This is why X3J11 invented "volatile" rather than "novolatile". >register static double d[100]; How does the register-nonaddressibility rule interact with the automatic decay of the array expression "d" into the pointer "&d[0]"? You'd need to define the rules very carefully to make this declaration useful. >char *strcpy(char register *p, register *q;) { ... } Minor nit: types don't propagate in a function prototype; you need "char" in both declarations. And no semicolon. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint