Consider a trace call such as TRACE_PRINT5("my favorite variable: %g", sum). The macro can print both the value and the source expression that produced it, yielding output such as main:25:(sum): my favorite variable: 889. section 16.3
In a function-like macro, # placed before a parameter converts that argument's tokens into a string literal. The preprocessing phase treats the argument textually, preserving its source form with possible whitespace adjustment. section 16.3
TAKEAWAY
- Stringification does not expand macros in the directly stringified argument. section 16.3
- Use two macro levels when the argument itself must expand first: STRGY(__LINE__) expands the line number, then STRINGIFY converts it to text. section 16.3
- Stringification also applies to __VA_ARGS__, retaining the textual representation and separating commas. section 16.5.1
Expressions become trace labels
TRACE_PRINT9("a collection: %g, %i", sum*acos(0), argc) produces main:31:(sum*acos(0), argc) a collection: 1396.44, 2. The displayed expression is text; the arguments are still evaluated separately for formatting.

