From a6094d81bb52f906208e7cc7b66f139f0926f4e3 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Fri, 19 Jul 2024 20:41:41 +0800 Subject: [PATCH] apps/canutils: fix the build warning on greenhills compiler CC: stdlib/lib_srand.c "candump.c", line 231: warning #550-D: variable "ret" was set but never used int opt, ret; ^ "candump.c", line 101: warning #550-D: variable "cmdlinename" was set but never used static char *cmdlinename[MAXSOCK]; ^ Signed-off-by: guoshichao --- canutils/candump/candump.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/canutils/candump/candump.c b/canutils/candump/candump.c index 0c5cf17e0..66dabef73 100644 --- a/canutils/candump/candump.c +++ b/canutils/candump/candump.c @@ -99,7 +99,6 @@ const char col_on [MAXCOL][19] = {BLUE, RED, GREEN, BOLD, MAGENTA, CYAN}; const char col_off [] = ATTRESET; -static char *cmdlinename[MAXSOCK]; static __u32 dropcnt[MAXSOCK]; static __u32 last_dropcnt[MAXSOCK]; static char devname[MAXIFNAMES][IFNAMSIZ+1]; @@ -229,7 +228,7 @@ int main(int argc, char **argv) unsigned char logfrmt = 0; int count = 0; int rcvbuf_size = 0; - int opt, ret; + int opt; int currmax, numfilter; int join_filter; char *ptr, *nptr; @@ -394,8 +393,6 @@ int main(int argc, char **argv) return 1; } - cmdlinename[i] = ptr; /* save pointer to cmdline name of this socket */ - if (nptr) nbytes = nptr - ptr; /* interface name is up the first ',' */ else @@ -618,7 +615,7 @@ int main(int argc, char **argv) if (timeout_current) *timeout_current = timeout_config; - if ((ret = select(s[currmax-1]+1, &rdfs, NULL, NULL, timeout_current)) <= 0) { + if ((select(s[currmax-1]+1, &rdfs, NULL, NULL, timeout_current)) <= 0) { //perror("select"); running = 0; continue;