user3260022
user3260022

Reputation: 69

Coverity static analysis for C programs

I am new to Static analysis tool and I am trying to build a simple checker. When I am throwing a OUTPUT_ERROR, I am also getting some more details with tags like "cond_true" etc. Is there a way I can stub these and print only the error I want to see.

Thanks.

Upvotes: 0

Views: 6095

Answers (2)

Scott McPeak
Scott McPeak

Reputation: 12749

This question is asking about writing a checker using the Extend SDK. There are two kinds of Extend checkers, flow-sensitive and flow-insensitive. The Extend documentation explains how to choose the kind of checker. Flow-sensitive checkers emit the cond_true events because they show the specific control flow path along which the issue was found; they cannot be suppressed. Flow-insensitive checkers do not emit them, so perhaps that is what you want to use.

Upvotes: 0

Sivanantham M
Sivanantham M

Reputation: 91

First You have to use cov-build to create intermediate files.With this command u have to specify the make (makefile). After that It will create emit file where you mentioned in cov-build command.

Then You have to use cov-analyze to create analyze report.If there is any Bugs found means it will return on terminal.

To show that errors in html file you have to use cov-format-errors.This command will create error directory.In that directory you can find the html statistical report for your analyzed code..

Example commands:

(if the program is in same folder(bin), it will create emit file in current directory(bin/emit)).

cov-build --dir . gcc hi.c

(if you want to build for a single .c file)

OR

cov-build --dir . make

(to use make command You have to create makefile.(vi makefile in bin,write your own script about compiling programs which is going to be build by cov-build))

cov-analyze --dir .

cov-format-errors --dir .

Upvotes: 0

Related Questions