I have a bit of a problem with a memory test routine I'm writing.

Consider this piece of code [fragment]:-

Address=&MemoryBlock;
(*Address)=0xAA;
        if ( (*Address) != 0xAA )
        { /* We never get here because the (*Address) location is not re-read 
*/ }

I can declare the MemoryBlock variable as volatile [I have done], but that 
doesn't mean that the compiler knows that (*Address) is also implicitly 
volatile in this situation.

I'm using 2.7.0 happily enough so-far, but I thought I'd run this problem past 
y'all to see of there's any elegant solution [pragma?] I could apply without 
having to write code to deliberately confound the optimisation process?

-- 
Richard.
PGP Key-id: 0x5AB3D350

Ever since prehistoric times, wise men have tried to understand what,
exactly, make people laugh.  That's why they were called "wise men."
All the other prehistoric people were out puncturing each other with
spears, and the wise men were back in the cave saying: "How about:
Would you please take my wife?  No.  How about: Here is my wife, please
take her right now.  No How about:  Would you like to take something?
My wife is available.  No.  How about ..."
                -- Dave Barry, "Why Humor is Funny"

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to