嗨,这是我的代码的一部分,并且得到了这个逻辑代码的一些MISRA警告:
#define NASSERT(x) std::_nassert(x)
void fun(
const uint8_t * restrict src ,
uint8_t * restrict dst
){
NASSERT(((int32_t) src % 8) == 0); //line 1
NASSERT(((int32_t) dst % 8) == 0); //line 2
}警告:(在第1行和第2行)
Warning 522: Highest operation, a 'constant', lacks side-effects [MISRA 2004 Rule 14.2]
Error 40: Undeclared identifier 'std'你能指导我解决这个问题吗?
发布于 2014-02-03 18:50:02
当您在C++中编程时,您正在使用C的MISRA检查器。
MISRA C:2004是针对C编程语言的。
您应该使用MISRA C++:2008。
https://stackoverflow.com/questions/21524430
复制相似问题