Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

geninfo confused by gcov output with multi-line statements: "unexecuted block on non-branch line with non-zero hit count."

Open
#554 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c, perl
Domain
tooling

Research direction

Start with geninfo and the gcov JSON handling; the issue does not identify a specific source file or test. Run the provided reproducer with GCC 15 and compare its gcov output with GCC 14, focusing on the multi-line statement and the unexecuted_block, branches, and count fields. Done means geninfo handles the GCC 15 output without the spurious warning while preserving correct coverage counts.

Written by the indexing model from the issue text.

Description

Hi,

gcc's coverage output starting with gcc-15 leads to complaints about "unexecuted block on non-branch line with non-zero hit count.".

I simplified the real-world case to this reproducer:

int main(int argc, char **argv)
{
	/* triggers spurious complaints unless newline is removed */
    char *foo =
		argc > 0 ? argv[0] : 0;
}
export GCC_VER=15 PATH="/home/andres/src/lcov/bin/:$PATH"
rm -f *.gcno *.gcda *.gcov *.info.* *.json.gz
gcc-${GCC_VER} --coverage coverage_bug_a.c -o coverage_bug_a
./coverage_bug_a || true
geninfo --gcov-tool gcov-${GCC_VER} .

results in this warning, unless using geninfo_unexecuted_blocks=1 is used:

...
using: chunkSize: 1, nchunks:1, intervalLength:0
geninfo: WARNING: (inconsistent) /home/andres/tmp/coverage_bugs/coverage_bug_a.c:4: unexecuted block on non-branch line with non-zero hit count.  Use "geninfo --rc geninfo_unexecuted_blocks=1 to set count to zero.
	(use "geninfo --ignore-errors inconsistent,inconsistent ..." to suppress this warning)
...

With <= gcc-14 this does not happen.

The complaint seems to be triggered by the fact that starting with gcc 15, line 4 "unexecuted_block": true is reported, while having "branches": [], and "count": 1,; line 5 is reported as "unexecuted_block": false,, while having branches, including one with "count": 0,

Whereas before that, "unexecuted_block": false, was reported for line 4 and "unexecuted_block": true.

I'm not sure gcc > 15 behavior is clearly better, but it's also not really wrong, given that the block really starts in line 4, not line 5.

FWIW, this triggers complaints with lcov going at least back to 2.0.

Greetings,

Andres

Dominant language
Shell
Stars
1.1k
Forks
272
Avg merge
2d 4h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linux-test-project/lcov

All issues in linux-test-project/lcov

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.