请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F280039C 尊敬的专家:
我的客户想要向编译器解析器中添加定制错误、例如、我们已经遇到了:
- #66期待一个";"
但是如何添加
- #999我定义的错误
是否可以这样做?
谢谢。
挂起
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.
尊敬的专家:
我的客户想要向编译器解析器中添加定制错误、例如、我们已经遇到了:
但是如何添加
是否可以这样做?
谢谢。
挂起
使用 C11功能进行称为静态断言的编译时间检查。 例如...
#include <assert.h>
void fxn(void)
{
static_assert(sizeof(char) < sizeof(int), "char is NOT smaller than int!");
}
由于默认情况下不启用 C11支持、因此请使用编译器选项 ——C11 。
谢谢。此致、
-乔治