This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gcc and the volatile keyword


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]