Solved !
We have some C/C++ files with and without exceptions handling, so lcov/gcov process "exceptions handling" for each code block.
Inside a normal block, for example:
int main(void)
{
...
...
[+ -] printf("Hello
");
...
}
gcov reports that printf line has a "branch coverage" of 50% ---> WHY ?
Because exceptions handling is enabled !!!
In order to solve this issue, specify:
-fno-exceptions
in g++ command line.
Example:
g++ -O0 --coverage -fno-exceptions -fno-inline ....
Thanks !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…