This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

串口打印宏定义报错

Other Parts Discussed in Thread: MSP430FR6972

芯片:MSP430FR6972

IDE:IAR6.30.1

问题描述:

我想使用宏定义的方式使用printf,但是按照下面这种方式一直报警告(

Warning[Pe1665]: concatenation with "down" in macro "DEBUG" does not create a valid token F:\WorkSpace\PW_KSH_C1_V1.0\Src\data_deal.c 550

)

所以想请教一下如何定义才算正确?

#if USE_DEBUG==1

#define DEBUG(format, ...) printf(format,##__VA_ARGS__)
#else
#define DEBUG(format, ...)
#endif