[ECOS] Gcc and the volatile keyword
Andrew Lunn
andrew@lunn.ch
Thu Feb 16 09:00:00 GMT 2006
> Would that insure that values would not be left in the registers?
>
> And on a more global note, I've already told the HAL to allocate this
> memory out of uncached memory space so if I'm not spin looping on these
> values do I even need volatile?
volatile means more than just do not use a register. It also ensures
the compiler does not change the order of operations and it does not
combine operations on the same variable or throw away apparently
useless statements.
In summary, keep the volatile.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list