Part Number: TMS320F280039C
Hi experts,
My customer would like to add custom errors to the compiler parser, for example, we already have:
- #66 expected a ";"
But how to add
- #999 a error defined by me
Is it possible to do so
Thanks,
Hang
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.
Part Number: TMS320F280039C
Hi experts,
My customer would like to add custom errors to the compiler parser, for example, we already have:
But how to add
Is it possible to do so
Thanks,
Hang
Use the C11 feature for a compile time check called a static assert. For example ...
#include <assert.h>
void fxn(void)
{
static_assert(sizeof(char) < sizeof(int), "char is NOT smaller than int!");
}
Because C11 support is not enabled by default, use the compiler option --c11.
Thanks and regards,
-George