-
-
usr/src/cmd/vi/port/ex_vmain.c (Diff revision 1) For `n' I searched but truly did not find any usage past its assignment. Mightn't it be removed along with line 636?
8737 vi: variable set but not used
Review Request #688 — Created Oct. 27, 2017 and submitted
Information | |
---|---|
tsoome | |
illumos-gate | |
8737 | |
2392b3b... | |
Reviewers | |
general | |
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 variabletmp1' is used only in the PRESUNEUC conditional case, although it's set just before the conditional. If you move the line
tmp1 = 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.
Change Summary:
remove n and rework tmp1 as suggested
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+3 -6) |