当前位置:网站首页>Summary of some classic embedded C interview questions

Summary of some classic embedded C interview questions

2022-06-11 14:30:00 Xiaoxi coding

#error What is the role of ?

#error   The instruction causes the preprocessor to issue an error message , And it interrupts the compilation process . So let's start with Linux Extract a small piece of code from the code and modify it to get the sample code :

This sample code is simple , When RX_BUF_IDX The value of the macro is not 0~3 when , In the preprocessing phase, it goes through  #error   The command outputs an error message :

"Invalid configuration for 8139_RXBUF_IDX"

Let's compile and take a look at the results :

Recommended articles : Get to know #pragma、#error Instructions

原网站

版权声明
本文为[Xiaoxi coding]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111410427234.html