http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53935

             Bug #: 53935
           Summary: [avr][c++] missing warning for non-const data in
                    progmem
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: g...@gcc.gnu.org
                CC: eric.wedding...@atmel.com
            Target: avr


#define PROGMEM __attribute__((progmem))

const char* PROGMEM arr[] = { "c" };

char foo (void)
{
    arr[0] = "x";
}


This C++ mudule puts arr[] in progmem as requested. However, the compiler does
not complain that arr[] needs to be read-only like the C compiler does:

error: variable 'arr' must be const in order to be put into read-only section
by means of '__attribute__((progmem))'

Reply via email to