Paul Koning <[EMAIL PROTECTED]> writes:

> Still, never mind what the C spec appears to say, optimizing away the
> cast cannot possibly what the user intended.

The user might have written a routine which takes a 'volatile int *',
with the intent that routine would be used on both regular and
volatile 'int's.  The compiler might be able to see (after inlining)
that this particular instance does not actually refer to a volatile
variable, and so be able to optimise the routine better.

(This is almost exactly the same argument as for a routine which takes
an 'int *' but gets called with a value cast from 'const int *'.)

Reply via email to