avr-gcc-list
[Top][All Lists]
Advanced

[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/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]