J
Jeff Newman
Hello,
Could anyone explain to me why the following class's destructor shows
up as having multiple branches? (At least as judged by gcov 4.1.2
when compiled with gcc 4.1.2 ):
struct blah
{
blah();
virtual ~blah();
};
blah::blah()
{
}
blah::~blah()
{
}
int main()
{
blah myBlah;
return 0;
}
The output from gcov showing these branches (with 1 not taken):
1: 11:blah::~blah()
-: 12:{
1: 13:}
branch 0 never executed
branch 1 never executed
call 2 never executed
branch 3 taken 0 (fallthrough)
branch 4 taken 1
call 5 never executed
branch 6 never executed
branch 7 never executed
call 8 never executed
Please note that if I make the destructor non-virtual, the branches go
away. Is what I'm seeing here a relic of the tool, or is there
something going on the language that causes this?
Could anyone explain to me why the following class's destructor shows
up as having multiple branches? (At least as judged by gcov 4.1.2
when compiled with gcc 4.1.2 ):
struct blah
{
blah();
virtual ~blah();
};
blah::blah()
{
}
blah::~blah()
{
}
int main()
{
blah myBlah;
return 0;
}
The output from gcov showing these branches (with 1 not taken):
1: 11:blah::~blah()
-: 12:{
1: 13:}
branch 0 never executed
branch 1 never executed
call 2 never executed
branch 3 taken 0 (fallthrough)
branch 4 taken 1
call 5 never executed
branch 6 never executed
branch 7 never executed
call 8 never executed
Please note that if I make the destructor non-virtual, the branches go
away. Is what I'm seeing here a relic of the tool, or is there
something going on the language that causes this?