[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Structs in program memory.
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Structs in program memory. |
Date: |
Tue, 27 Apr 2004 11:00:15 +0200 (MET DST) |
Christian Ludlam <address@hidden> wrote:
> Not necessarily; if the compiler is aware of the different address
> spaces it can change the generated code to access it correctly. Then
> it would just be a case of changing the declaration of a variable -
> the C code to read it would be the same.
You also need to be careful in some ways. E. g. if you always put
const char *foo = "Hello world!\n";
into ROM, you are probably close to violate the C standard (yes, the
other AVR compilers do it under some circumstances) since the
resulting pointer can no longer be passed to the standard str*()
functions.
The way out of this would be the ``generic pointers'' that have been
implemented in some C51 compilers, but that's a move towards OO
(including all its downsides, like code bloat and runtime
pecularities).
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/
- Re: [avr-gcc-list] Structs in program memory., (continued)
- Re: [avr-gcc-list] Structs in program memory., Joerg Wunsch, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., E. Weddington, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., Svein E. Seldal, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., E. Weddington, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., Artur Lipowski, 2004/04/28
- Re: [avr-gcc-list] Structs in program memory., David Brown, 2004/04/28
- Re: [avr-gcc-list] Structs in program memory., E. Weddington, 2004/04/28
- Re: [avr-gcc-list] Structs in program memory., Svein E. Seldal, 2004/04/28
- Re: [avr-gcc-list] Structs in program memory., Svein E. Seldal, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., Christopher X. Candreva, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory.,
Joerg Wunsch <=
- Re: [avr-gcc-list] Structs in program memory., Graham Davies, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., E. Weddington, 2004/04/27
- Re: [avr-gcc-list] Structs in program memory., Dmitry K., 2004/04/28
- Re: [avr-gcc-list] Structs in program memory., Svein E. Seldal, 2004/04/28