3

I would like to know how to suppress this defect found by 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

The problem is with this code:

//Initialize MMI sub-component
result = VDM_MMI_init();
if (result != VDM_ERR_OK)
    goto err;

that calls this function:

VDM_Error VDM_MMI_init(void)
{
    return VDM_ERR_OK;
}

The structure has to be maintained as VDM_MMI_init() may return an error in the future.

I am looking for any kind of macro or comment can be embedded in the code that will tell C++test to ignore this problem

eyalm
  • 3,366
  • 19
  • 21

3 Answers3

4

Looking around, you may be able to suppress it with the following:

#pragma parasoft suppress item BD-PB-CC

Then after the warning site:

#pragma parasoft unsuppress item BD-PB-CC

Sources: http://forums.parasoft.com/index.php?showtopic=1566 and http://www-afs.secure-endpoints.com/afs/usatlas.bnl.gov/sun4x_59/app/codewizard-4.3-WS6.0u1/manuals/howsupp_.htm

slugonamission
  • 9,562
  • 1
  • 34
  • 41
1

I got from parasoft support the following comment notation

/* parasoft-suppress BD_PB_CC  "THIS IS SUPPRESSION COMMENT" */

To be put at the end of violated line (with space following end of your code) Note that rule ID must match violated rule. What’s in quotation marks, is your suppression comment.

eyalm
  • 3,366
  • 19
  • 21
1

You can simply type:

int a = 0; // parasoft-suppress RULE.ID

and violation will be suppressed

MichaelMocko
  • 5,466
  • 1
  • 21
  • 24