8737 vi: variable set but not used
Review Request #688 — Created Oct. 27, 2017 and submitted
ex_vmain.c: In function 'vmain': ex_vmain.c:620:19: error: variable 'tmp1' set but not used [-Werror=unused-but-set-variable] unsigned char tmp1; ^~~~ ex_vmain.c:617:19: error: variable 'n' set but not used [-Werror=unused-but-set-variable] int tmp, len, n; ^ cc1: all warnings being treated as errors
Yes, you should just remove the declaration of the variable
n' along with the line that sets it.n' is truely unused. As well, the variable
tmp1' is used only in the PRESUNEUC conditional case, although it's set just before the conditional. If you move the linetmp1 = mbuf[tmp_1]' down one line, so that it's just before where it is used, you can also move the declaration into the correct case. With those changes, you won't need to mark any variables as possibly unused.