[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] memcpy() : problem when passing destination pointer
From: |
Vincent Trouilliez |
Subject: |
Re: [avr-gcc-list] memcpy() : problem when passing destination pointer |
Date: |
Wed, 11 Feb 2009 03:01:34 +0100 |
On Tue, 10 Feb 2009 21:56:39 +0100 (MET)
address@hidden (Joerg Wunsch) wrote:
> As the code works as is (with the warning), I bet the volatile
> qualification wasn't needed at all in the first place, and could as
> well be omitted.
I can't find any reference to the volatile keyboard in the
current avr-libc manual (1.6.2), but my understanding of volatile comes
from an older avr-libc manual (somewhere in the FAQ section IIRc) years
ago when I debuted my AVR project.
IIRC it said volatile must be used to keep the compiler from optimizing
away access to a variable that he thinks might be pointless. Like
writing a variable that is never read back.
In my case I was writing to a buffer from an ISR, but it was not read
in that C file, only from a different one, hence invisible to the
compiler. So my understading was: "in that particular file, GCC sees
that I am writing to the buffer, but never reading it, so he might
think it's useless to write to it ! So I added the volatile keyword,
thinking it would stop him from thinking too much ! ;-)
Is my understanding of volatile wrong ?
--
Vince
- [avr-gcc-list] memcpy() : problem when passing destination pointer, Vincent Trouilliez, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Graham Davies, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Vincent Trouilliez, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Joerg Wunsch, 2009/02/10
- RE: [avr-gcc-list] memcpy() : problem when passing destination pointer, Weddington, Eric, 2009/02/10
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Vincent Trouilliez, 2009/02/11
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Bernard Fouché, 2009/02/11
- RE: [avr-gcc-list] memcpy() : problem when passing destination pointer, Dave Hansen, 2009/02/11
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Paulo Marques, 2009/02/11
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, Bernard Fouché, 2009/02/11
- Re: [avr-gcc-list] memcpy() : problem when passing destination pointer, David Kelly, 2009/02/11
- [avr-gcc-list] Re: memcpy() : problem when passing destination pointer, David Brown, 2009/02/11