This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63760] New: Support __func__ in PROGMEM
- From: "mojo at world3 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Nov 2014 09:27:34 +0000
- Subject: [Bug c/63760] New: Support __func__ in PROGMEM
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63760
Bug ID: 63760
Summary: Support __func__ in PROGMEM
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mojo at world3 dot net
The C99 __func__ magic variable is defined as:
static const char __func__[] = "function-name";
On architectures such as AVR where there is a distinction between program
memory and RAM this definition is not ideal. It will place the string in RAM,
even though it is constant. Devices using these Harvard style architectures
typically have very little RAM, a few kilobytes at most.
I suggest adding a __funcP__ magic variable that is defined as:
static const char __funcP__[] PROGMEM = "function-name";
That way the string will end up in program memory, which is almost always much
larger than available RAM and is commonly used for the storage of constant
strings.