Skip to content

Commit 10b11ea

Browse files
committed
geninfo: Ignore empty .gcno files with --initial
Some versions of GCC create empty .gcno files which cause geninfo to abort processing with an error message: geninfo: ERROR: dummy.gcno: reached unexpected end of file Fix this problem by skipping empty .gcno files. Reported-by: Maarten Hoes <[email protected]> Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent f9d8079 commit 10b11ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/geninfo

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,13 @@ sub process_graphfile($$)
22882288
$base_dir = $source_dir;
22892289
}
22902290

2291+
# Ignore empty graph file (e.g. source file with no statement)
2292+
if (-z $graph_filename)
2293+
{
2294+
warn("WARNING: empty $graph_filename (skipped)\n");
2295+
return;
2296+
}
2297+
22912298
if ($gcov_version < $GCOV_VERSION_3_4_0)
22922299
{
22932300
if (is_compat($COMPAT_MODE_HAMMER))

0 commit comments

Comments
 (0)