problem assigning value to global variables

Nicole Cook cook@maya.com
Tue May 2 11:24:00 GMT 2000


Art Berggreen wrote:
> You didn't include the call to readBuffer.  I hope you are not expecting
> the "buffer" variable in the readBuffer() function to be the same as the
> global "buffer" array.  One is a global variable, the other is a formal
> parameter to the function with a scope local to that function.
> 

It's called as readBuffer(buffer).

> Second, (I don't know how IDE drives behave) if successive reads to
> DATA_PORT return different values, you want to make sure that DATA_PORT
> is declared as a pointer to volatile.  Otherwise the compiler can
> optimize the read out of the loop and only read once.  This could change
> between compiler versions.
> 

It wasn't declared as a pointer to volatile (it should be, and I've
changed it), but the assembly code has the read inside the loop either
way - so that's not the problem, unfortunately.  Is there some
difference in the way the different compiler versions assign pointers? 
Or where they locate global variables?


Nicole

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list