1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: improve unused label check

This commit is contained in:
Alexander Medvednikov 2022-07-23 01:36:27 +03:00
parent 4d3401c852
commit d6de53362f
2 changed files with 2 additions and 1 deletions

View File

@ -158,7 +158,7 @@ fn print_backtrace_skipping_top_frames_msvc(skipframes int) bool {
lnumber := sline64.f_line_number
lineinfo = '$file_name:$lnumber'
} else {
addr:
// addr:
lineinfo = '?? : address = 0x${(&frame_addr):x}'
}
sfunc := unsafe { tos3(fname) }

View File

@ -3915,6 +3915,7 @@ fn (mut c Checker) check_unused_labels() {
if nr_uses == 0 {
// TODO show label's location
c.warn('label `$label` defined and not used', token.Pos{})
c.goto_labels[label]++ // so that this warning is not shown again
}
}
}