I am using lcov/gcov to measure test coverages in a project.
However, the test coverage report includes some lines signaled as unhitted that shouldn't be there. For example:
Comment lines, function definitions splitted across two lines, opening brackets, etc are counted towards total coverage as not covered.
How can I instruct lcov/gcov to ignore such lines?

Finally, I solved the issue. Looking at gcov man page (https://linux.die.net/man/1/gcov) I found that
gcov works only on code compiled with GCC . It is not compatible with any other profiling or test coverage mechanism.Default C compiler in my system was ClangC. Setting
gccas compiler when callingcmakethis way$ cmake . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/gccsolved the problem.