This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/53935] New: [avr][c++] missing warning for non-const data in progmem
- From: "gjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 08:02:39 +0000
- Subject: [Bug target/53935] New: [avr][c++] missing warning for non-const data in progmem
- Auto-submitted: auto-generated
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))'