avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] only initialized variables can be placed into program mem


From: Rick Mann
Subject: Re: [avr-chat] only initialized variables can be placed into program memory area
Date: Mon, 2 Jul 2012 01:53:27 -0700

Hey Dave!

Thanks. I see it appears fixed in GCC 4.6, but CrossPack AVR doesn't include 
that yet. (Sadly, GCC 4.5 broke some inline asm I was using). Anyway, I'll try 
the workaround. Perhaps AVR libc should be modified, too?

-- 
Rick

On Jul 2, 2012, at 0:14 , David A. Lyons wrote:

> This is the C++ workaround I've been using:
> 
> // PROGMEM workaround for C++ bogus-warning bug in avr-gcc:
> //      <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734>
> //      
> <http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=100009>
> //
> #define PROG_MEM                            
> __attribute__((section(".progmem.mydata")))
> 
> ...and then use PROG_MEM where I would have used PROGMEM.
> 
> Cheers,
> 
> --Dave
> 
> On Jul 1, 2012, at 8:49 PM, Rick Mann <address@hidden> wrote:
> 
>> Also: this is a .cpp file. I found some of the AVR Freaks thread. They say 
>> it's a known problem in GCC C++. Sigh.
>> 
>> -- 
>> Rick
>> 
>> On Jul 1, 2012, at 20:45 , Rick Mann wrote:
>> 
>>> Hi. I'm trying to use pgmspace with avr-gcc 4.3.3. The archive had this 
>>> question posted (in reference to WinAVR), and some discussion about a 
>>> thread in AVR Freaks, but AVR Freak's search isn't very good (I've never 
>>> liked phpBBS).
>>> 
>>> Can anyone tell me if I can safely ignore that warning, and if there's a 
>>> newer version of GCC that doesn't emit it?
>>> 
>>> I modified a line like
>>> 
>>>     printf("foo\n");
>>> 
>>> to
>>>     printf_P(PSTR("foo\n"));
>>> 
>>> and get that warning.
>>> 
>>> Thanks,
>>> Rick
>>> 
>>> 
>>> _______________________________________________
>>> AVR-chat mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/avr-chat
>> 
>> 
>> _______________________________________________
>> AVR-chat mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/avr-chat
> 




reply via email to

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