Skip to content

Commit

Permalink
apps/canutils: fix the build warning on greenhills compiler
Browse files Browse the repository at this point in the history
CC:  stdlib/lib_srand.c "candump.c", line 231: warning apache#550-D: variable "ret" was set but never used
  	int opt, ret;
  	         ^

"candump.c", line 101: warning apache#550-D: variable "cmdlinename" was set but
          never used
  static char *cmdlinename[MAXSOCK];
               ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
  • Loading branch information
extinguish authored and xiaoxiang781216 committed Aug 18, 2024
1 parent 8cb59a7 commit a6094d8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions canutils/candump/candump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a6094d8

Please sign in to comment.