[Bug target/53935] New: [avr][c++] missing warning for non-const data in progmem
gjl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 12 08:02:00 GMT 2012
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: unassigned@gcc.gnu.org
ReportedBy: gjl@gcc.gnu.org
CC: eric.weddington@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))'
More information about the Gcc-bugs
mailing list