Topic : The Print Information Warning about STM32

Forum : ARM

Original Post
Post Information Post
June 27, 2017 - 10:30am
permofrost li

Hello~

I defined the err_log as following:

#define err_log(format, ...) printf( "file:" __FILE__ "; line:%d; " format "\n", __LINE__, ##__VA_ARGS__)

However,when I am using err_log to print information,such as “ err_log("hello world\r\n");” the warning will display: illegal character encoding in string literal. I am assure that the compiled printing has no problem. The warning will disappear when I used printf instead of err_log. I would like to ask why? I cannot understand !  The datasheet of STM32 is given: http://www.kynix.com/uploadfiles/pdf8798/STM3210B-PRIMER.pdf