我想知道如何抑制parasoft发现的此缺陷
BD-PB-CC:Condition "result != 0" always evaluates to false
/home/redbend/dev/vdm-10.2/sdk/source/engine/core/src/vdm_core_api.c:82
问题在于此代码:
//Initialize MMI sub-component
result = VDM_MMI_init();
if (result != VDM_ERR_OK)
goto err;
调用此函数:
VDM_Error VDM_MMI_init(void)
{
return VDM_ERR_OK;
}
必须维护该结构,因为VDM_MMI_init()将来可能会返回错误。
我正在寻找可以在代码中嵌入任何种类的宏或注释,这些代码将告诉C ++ test忽略此问题
最佳答案
环顾四周,您可以通过以下操作来抑制它:
#pragma parasoft suppress item BD-PB-CC
然后在警告站点之后:
#pragma parasoft unsuppress item BD-PB-CC
来源:http://forums.parasoft.com/index.php?showtopic=1566和http://www-afs.secure-endpoints.com/afs/usatlas.bnl.gov/sun4x_59/app/codewizard-4.3-WS6.0u1/manuals/howsupp_.htm