volatile, noalias and optimization

Karl Heuer karl at haddock.ISC.COM
Wed Apr 27 05:42:48 AEST 1988


In article <132 at atpal.UUCP> uunet!pwcmrd!skipnyc!atpal!tneff (Tom Neff) writes:
>This is a wonderful feature ... but shouldn't we use
>        #pragma volatile(var1, var2, var3)
>instead of imposing a new keyword on the language grammar?

Unless you expand on this a bit, it's not as powerful.  I've actually used the
declaration "char volatile * volatile p;" (a volatile pointer to volatile
memory) -- would your proposal handle this?

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
(In case anyone cares, p was volatile because it was being used by both
branches after a fork(), and *p because it was a shared memory segment.)



More information about the Comp.lang.c mailing list