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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] AVR-GCC question


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] AVR-GCC question
Date: Sat, 21 May 2005 22:14:54 +0200 (MET DST)

"James A. Kinnard" <address@hidden> wrote:

> The best option that it seems I have to port this application using
> AVR-GCC is to use the PSTR(s) macro around EACH of these string
> literals in order to force the compiler to place them into FLASH and
> ONLY FLASH.  I can define a null PSTR(s) to maintain backward
> compatibility with ImageCraft, which I must have.  Is this the best
> option I have or is there something in the documentation I have
> missed?

It seems it's the best option, yes.

An editor that can handle regular expressions might be a good help for
you in this, as it can easily do this within a single command (per
file, of course).

> Is there a plan to add the 'global string literals in FLASH' option
> to a future release of AVR-GCC?

If you browse the archives of this mailing list back quite some time,
maybe a year or two, you'll find a discussion about this.

To make a long story short, defaulting all string literals to flash
basically violates the C standard, as you cannot apply any of the C
standard string functions to these strings anymore.  (That's the
reason why any serious compiler doesn't offer this as the default
either.)  In order to handle this correctly, i.e. standard compliant,
memory spaces need to be implemented into GCC.  There's a standards
proposal for memory spaces in C, but it needs someone to actually
implement that into GCC (which is anything but a leightweight task,
alas).

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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