Mai Nguyen
Mai Nguyen

Reputation: 21

Coverity: the build capture percentage is undesirably 0%

I using Coverity to analyze code C.

config command:

cov-configure --compiler /opt/toolchains/stbgcc-4.5.4-2.9/bin/mipsel-linux-uclibc-gcc --comptype gcc --config /opt/cov-analysis-linux64-7.5.1/config/coverity_config.xml

And configuration step is successfully.

Build command:

cov-build --dir ../platform/drivers --record-only --encoding EUC-KR sudo make platform FORCE=1

When coverity build had finished, i saw in build-log: The cov-build utility completed successfully. And the warning in pop up block:

the build capture percentage is undesirably 0%

error

Then i still analyze data:

Analyze command:

cov-analyze --user-model-file >~/work/CoverityData/stdioUserModel.xmldb --parse-warnings-config >~/work/CoverityData/parse_warnings.conf --dir ../platform/drivers/ >--all --checker-option NO_EFFECT:extra_comma:0 -j 4

and i got error:

Error: intermediate directory contains no translation units.

I guess the warning in build-step made the error in analysis step.

Please help me solve this.

Upvotes: 0

Views: 2115

Answers (2)

mjs
mjs

Reputation: 3005

You should check in the build_log file, located in ../platform/drivers/. Look for lines containing [ERROR] - there may be errors locating header files etc.

Another possibility is to perform a test build first - this might only be possible from the IDE - to ensure that the build is being invoked correctly

Upvotes: 0

Caleb
Caleb

Reputation: 1173

The issue may be with the --record-only portion of your cov-build invocation - that captures the compiler invocations, but doesn't actually emit them. Try removing that and try again. Alternatively, you could use cov-build --replay -j X to replay those compilations; some caveats apply, it's usually best to capture the compilations directly.

Please note that using sudo in your build command is exceptionally dangerous and should be avoided. Is it really necessary?

Upvotes: 1

Related Questions