On Wed, 2 Mar 2005, Bernardo Innocenti wrote:
> To move strings into program memory, there's a macro like this:
>
> #define PSTR(s) ({ static const char __c[] PROGMEM = (s); &__c[0]; })
>
>
> But this wouldn't work because __func__ does not work like
> a string literal:
>
> #define TRACEMSG(msg,...) __tracemsg(PSTR(__func__), msg, ## __VA_ARGS__)
>
> C99's __func__ is supposed to work as if a "const char __func__[]".
> The __FUNCTION__ extension could instead be made to work like a
> string literal. We could live without string pasting capabilities
> if it helps keeping the interface between cpp and the C frontend
> cleaner.
How about calling decl_attributes from fname_decl so a target
insert_attributes hook can add attributes to __func__? Would that suffice
to solve your problem?
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
[EMAIL PROTECTED] (personal mail)
[EMAIL PROTECTED] (CodeSourcery mail)
[EMAIL PROTECTED] (Bugzilla assignments and CCs)