我在C中有一个函数,它包含以下几行:
while (src=strstr(src,key)) {
memmove(src,src+strlen(key),1+strlen(src+strlen(key)));
}当我运行parasoft来检查函数时,我从以下几行收到了很多错误:
Not enclosed with brackets assignment was found in 'while' condition expression
LHS operand of '+' operator is 'unsigned long'
LHS operand of '+' operator is 'unsigned long'
LHS operand of '+' operator is 'unsigned long'
RHS operand of '+' operator is 'unsigned long'
RHS operand of '+' operator is 'unsigned long'
RHS operand of '+' operator is 'unsigned long'
Third param to 'memmove' function depends on second: src, key你知道这些错误来自哪里吗?
发布于 2016-03-03 16:31:50
第一条消息是因为工具怀疑你的意思是:
while (src == strstr(src, key)) { /* comparison instead of assignment */为了明确赋值的目的,一些工具要求您编写
while ((src = strstr(src, key))) {https://stackoverflow.com/questions/35766793
复制相似问题