Suppress issues

This section explains how to suppress macros, files, and directories using an external configuration (SCONF) file, with the following methods:

  • Import the SCONF file from Validate while running a connected project
  • Import the SCONF file using kwcheck or kwciagent, similar to other configuration files
  • Provide the SCONF file while running kwbuildproject --exclude-issues
With multiple macros, defects are reported relative to the parent macro, not the embedded macro. In the following example, the defect MISRA.CAST.VOID_PTR_TO_INT.2012 would be reported for the check_assert() macro, not for the MAP_FAILED macro:
#define MAP_FAILED (void *)-1
#define check_assert(expr) if (!expr) { abort(); }

void f(void *p)
{
	check_assert(p != MAP_FAILED);
}		

If you are using multiple or embedded macros and cannot suppress the parent macro, consider assigning the issue status manually in Validate (for example, changing it to Not a problem).

You can suppress issues using multiple suppression configurations by adding them to the same configuration file. You can also provide multiple configuration files.

When using kwbuildproject --replace-path, suppression uses the original path, not the path that has been replaced. It is recommended to use the path pattern. If you prefer to use the full path, use the original path, not the new path.