Skip to content

Commit

Permalink
Improved location and context for certain messages: more actionable. (#…
Browse files Browse the repository at this point in the history
…360)

Signed-off-by: Henry Cox <[email protected]>
  • Loading branch information
henry2cox authored Dec 19, 2024
1 parent d881ef9 commit 06f907a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/lcovutil.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4666,10 +4666,12 @@ sub define_function
#TraceFile::is_language('c', $self->filename()) &&
$data->line() != $start_line
) {
$location = '"' . $self->filename() . '":' . $start_line
unless defined($location);
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
(defined($location) ? "$location: " : '') .
"duplicate function '$fnName' starts on line $start_line but previous definition started on "
. $data->line() . '.')
"$location: duplicate function '$fnName' starts on line $start_line but previous definition started on "
. $data->line()
. MessageContext::context() . '.')
unless
grep({ $fnName =~ $_ } @lcovutil::suppress_function_patterns);
# if ignored, just return the function we already have -
Expand Down Expand Up @@ -4698,7 +4700,8 @@ sub define_function
" -> "
.
(defined($end_line) ? $end_line :
'undef'))
'undef') .
MessageContext::context())
unless
grep({ $fnName =~ $_ } @lcovutil::suppress_function_patterns);
# pick the highest end line if we didn't error out
Expand Down

0 comments on commit 06f907a

Please sign in to comment.