volatile: a summary

Steven Ryan smryan at garth.UUCP
Sun Jul 3 07:44:21 AEST 1988


>                              My fear is that we'll just keep adding
>new storage classes or other keywords as they are needed, making the
>language more and more complicated, rather than trying to develop a
>more general solution that fits within the current language.

My personal favorite is to first come up a computable total predicate that
verifies aliassing or whatever. Give the predicate a name the compiler
knows about, possibly restricting it to assertions, so that one could
write

            assert(distinct(a,b))

Then the compiler is given a predicate it can recognise and use for
optimisation and the programmer is given a construct that can (optionally)
verify the stated conditions. If the compiler can prove the predicate, it
can delete, otherwise its inclusion is left to the programmer. Subscript
checking is sometimes done in this fashion, although the assert mechanism
is often hidden.



More information about the Comp.lang.c mailing list