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: David A. Lyons
Subject: Re: [avr-chat] only initialized variables can be placed into program memory area
Date: Mon, 2 Jul 2012 00:14:21 -0700

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]