ref: eaef5482d5f32759d58a4d074cad6e70e5051f6d
parent: e94c2faaae73378752158690f8421efbf6fa76c8
author: cancel <cancel@cancel.fm>
date: Tue Dec 31 10:00:57 EST 2019
Add -Wshadow to tool build flags. And fixes a shadowed (but harmless) loop counter warning.
--- a/tool
+++ b/tool
@@ -209,7 +209,9 @@
local out_exe
add cc_flags -std=c99 -pipe -finput-charset=UTF-8 -Wall -Wpedantic -Wextra
if cc_id_and_vers_gte gcc 6.0.0 || cc_id_and_vers_gte clang 3.9.0; then
- add cc_flags -Wconversion -Wstrict-prototypes -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion
+ add cc_flags -Wconversion -Wshadow -Wstrict-prototypes \
+ -Werror=implicit-function-declaration -Werror=implicit-int \
+ -Werror=incompatible-pointer-types -Werror=int-conversion
fi
if [[ $lld_detected = 1 ]]; then
add cc_flags -fuse-ld=lld
--- a/tui_main.c
+++ b/tui_main.c
@@ -588,8 +588,8 @@
Oevent_osc_ints const* eo = &ev->osc_ints;
wprintw(win, "OSC\t%c\tcount: %d ", eo->glyph, eo->count, eo->count);
waddch(win, ACS_VLINE);
- for (Usz i = 0; i < eo->count; ++i) {
- wprintw(win, " %d", eo->numbers[i]);
+ for (Usz j = 0; j < eo->count; ++i) {
+ wprintw(win, " %d", eo->numbers[j]);
}
} break;
case Oevent_type_udp_string: {