Re: String array in ROM gives error in spite of following example code.

Senthil Kumar <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <CABvNLJuVXzRiMoyxPQZPk2c5P75cQwEF-Kj+HJ=0d521CzRjog@mail.gmail.com>
Does

PGM_P  const pgtmp_msg[]    PROGMEM =
   { ptmpUP_msg, ptmpDN_msg,  ptmpCLG_msg,} ;

work? The array itself needs to be declared const, as progmem/flash
contents cannot be modified.

Regards
Senthil


On Thu, Jun 12, 2014 at 6:16 PM, Bob Paddock <[email protected]>
wrote:

>  #define FLASH /* Empty, used for IAR compiler.  Define PROGMEM as
> empty to use GCC */
>
> static char const FLASH string000[] PROGMEM = "NO_MSG"; /* 000/0x00 */
> ...
>
> static PGM_P const string_pointers[] PROGMEM = {
>     string000, /* 0x00 */
> ...
> };
>
> That works without out warnings for C.  There was a long standing bug
> that you may be running into if you are compiling as C++.
>
> _______________________________________________
> AVR-GCC-list mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>

_______________________________________________
AVR-GCC-list mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.