请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:LAUNCHXL-F28P55X工具/软件:
我设置了一个新的链接工具来与我的项目一起运行、我遇到了_assert (...) 的问题 函数/定义。 从 ccs2020\ccs\tools\compiler\ti-cgt_c2000_22.6.2.LTs\lib\assert.h 中 src、_assert (……) 进行呼叫。 然而,我找不到这是定义的地方或它被记录的地方,所以我的解释者自然提出了一个错误,它找不到它的声明。 其中 _assert (...) 原因是什么?
#if defined(NDEBUG)
#define assert(_ignore) ((void)0)
#elif defined(NASSERT)
#define assert(_expr) _nassert(_expr)
#else
#if (defined(__clang__) && defined(__arm__)) || \
(defined(_AEABI_PORTABILITY_LEVEL) && _AEABI_PORTABILITY_LEVEL != 0)
extern void __aeabi_assert(const char *expr, const char *file, int line);
#define assert(__e) ((__e) ? (void)0 : \
__aeabi_assert(#__e, __FILE__, __LINE__))
#else
#define assert(_expr) _assert((_expr) != 0, \
"Assertion failed, (" _STR(_expr) "), file " __FILE__ \
", line " _STR(__LINE__) "\n")
#endif /* _AEABI_PORTABILITY_LEVEL, __clang__ */
#endif /* NDEBUG, NASSERT */