Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uftrace: Fix dead store warnings found by infer and
warning on compile time implicit declaration This patch fixes some dead store warnings found by a static analysis tool, called infer[1]. The warning messages are as follows. $ cd /path/to/uftrace $ infer run --force-integration make ... utils/debug.c:386: error: Dead Store The value written to `&percent` (type `double`) is never used. 384. void print_diff_percent(uint64_t base_nsec, uint64_t pair_nsec) 385. { 386. double percent = 999.99; ^ utils/debug.c:387: error: Dead Store The value written to `&sc` is never used. 385. { 386. double percent = 999.99; 387. const char *sc = get_color(COLOR_CODE_NORMAL); ^ 388. const char *ec = get_color(COLOR_CODE_RESET); 389. utils/kernel.c:57: error: Dead Store The value written to `&ret` is never used. 55. { 56. struct kfilter *pos, *tmp; 57. int ret = -1; ^ 58. int fd; 59. utils/perf.c:230: error: Dead Store The value written to `&start` is never used. 228. buf = &data[start & mask]; 229. size = end - start; 230. start += size; ^ And fix warning on compile time with including unistd.h header file. utils/kernel-parser.c:151:9: warning: implicit declaration of function 'close'; did you mean 'pclos'? [-Wimplicit-function-declaration] 151 | close(kp->fds[cpu]); | ^~~~~ | pclose [1] https://github.com/facebook/infer Fixed: namhyung#1553, namhyung#1859 Signed-off-by: Paran Lee <p4ranlee@gmail.com>
- Loading branch information