I'm trying to write a simple TRACE macro using IAR compiler. It's for a XMEGA 256A3. The macro looks like this (compiled using --string_literals_in_flash).
#define TRACE(x) printf_P("
s( d): ", __FILE__, __LINE__); printf_P x
I get garbage because of the __FILE__ symbol. The only way I've been able to use the macro is by assigning __FILE__ to a temporary variable before printing.
char file_name = __FILE__;
Why is the temporary variable necessary?