问题
I had a macro for logging that accepts a variable number of arguments. This macro will be processed by GCC in a non-embedded context, and expands to valid C code. Despite this, IAR EWARM gives the error "[Pe054]: too few arguments in macro invocation" wherever I call the macro (thousands of locations)
EWARM does provide diagnostics configuration to convert these errors to warnings (and hilariously enough, the code compiles when you do this (i.e. the "error" isn't a compilation error, the compiler is just dumb))
The problem is that when I try to first convert Pe054 to a warning, then try to suppress it, I can't do the latter.
回答1:
The solution is to take control of the order in which the operations are applied, like so:
First convert to warning, then suppress.
来源:https://stackoverflow.com/questions/26303415/how-to-suppress-warning-converted-from-error-in-iar-ewarm-5-4