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:
parent
4d3401c852
commit
d6de53362f
@ -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) }
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user