e tried this with other stl
container classes as well as other non-stl classes). For example, in the case
of coverage being produced beyond the end of the file for gcov 4.x, if I supply
the -b argument to gcov I get this at the end:
1: 22:}
function _GLOBAL__I_globalVar called 1 returned 100% blocks executed 100%
1: 23:/*EOF*/
call0 returned 100%
function _GLOBAL__D_globalVar called 0 returned 0% blocks executed 0%
#: 24:/*EOF*/
call0 never executed
Also, in the test case above, if I change the return value of doSomething() to
be an int instead of a std::string then the problem does not occur.
As another interesting datapoint, the above information is for running on a
Fedora Core 2 machine, but I get similar behavior using Apple's 4.0.0 compiler
that they ship with OSX 10.4 (Tiger) - However, in that case the /*EOF*/
coverage error on line 24 doe not occur. Only the one on line 14 occurs.
Perhaps that helps to isolate some part of this problem.
Please let me know if there is any more information that I can provide you to
help reproduce this problem. We are actively using gcov to quantify the code
coverage of our automated tests, so we'd love to see this problem get fixed and
I'm happy to help out as much as I can.
Cheers,
Martin.
--
Summary: [4.x Regression] incorrect gcov code coverage output in
4.0 and 4.1
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: major
Priority: P2
Component: gcov/profile
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reddy at pixar dot com
GCC build triplet: x86_64-redhat-linux-gnu
GCC host triplet: x86_64-redhat-linux-gnu
GCC target triplet: x86_64-redhat-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24550