avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Want to place __func__ in program memory


From: Wim Lewis
Subject: Re: [avr-gcc-list] Want to place __func__ in program memory
Date: Sun, 29 Apr 2012 14:29:02 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 4/29/12 11:46 AM, Alex Iljin wrote:
> In the same way I define DEBUG_ASSERT_PROGMEM macro.
> It is OK, but I want to use many trace and assert functions, so there
> is a question.
> Is there way to place function name in program memory?
> Maybe there are specific __FUNC_PROGMEM__ marco, or some compiler parameters,
> which switch __func__ from charecter array to string literal?

I had thought that __FUNCTION__ and __PRETTY_FUNCTION__ acted like
string literals and could be used this way, but I just tested and they
seem to act like __func__.

The type of __func__ is presumably dictated by the C++ standard, but
__FUNCTION__ and __PRETTY_FUNCTION__ are gcc-isms. Is there a technical
reason that the compiler couldn't treat them as equivalent to a
double-quoted string?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]