Question

I am trying to use cppcheck to analyze my c++ project. My command looks like this:

me@home:trunk/software/cpp/tnoid$ cppcheck -v --enable=all --xml -I ../../../package/build/common/cpp/ -I ../../../package/build/software/cpp/tnoid/ .

You can see where I include (-I) two additional directories. In the results instead of getting those (unfortunately long) relative paths back, it seems truncated, for example:

<error file="/../package/build/common/cpp/libutil/DeleteNullifier.h" line="34" id="postIncrementDecrement" severity="possible style" msg="Pre-Incrementing variable 'iter' is preferred to Post-Incrementing"/>

Perhaps I am using cppcheck incorrectly? Why does the file path in the error appear shortened? It's really messing with the cxx sonar plugins.

EDIT: This is using cppcheck version 1.40

Was it helpful?

Solution

Well as it turns out I needed to upgrade my cppcheck application anyway.

  • version in Ubuntu 10.04: 1.40
  • Newest cppcheck version: 1.58
  • newest sonar-supported: 1.54

Upgrading to 1.54 solved the problem. Relative paths are now correct.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top