kopia lustrzana https://github.com/Hamlib/Hamlib
Quell gcc 8.2.0 defined but not used warning
On Debian Buster gcc ((Debian 8.2.0-8) 8.2.0) was throwing the following warning: CC rigctl.o ../../hamlib/tests/rigctl.c:125:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=] static const int have_rl = 0; ^~~~~~~ and: CC rotctl.o ../../hamlib/tests/rotctl.c:113:18: warning: ‘have_rl’ defined but not used [-Wunused-const-variable=] static const int have_rl = 0; ^~~~~~~ Turns out I didn't have the readline-dev package installed. As the have_rl variable is wrapped in CPP macros, it indeed is not used when readline is not available.pull/58/head^2
rodzic
ac540c82cc
commit
b0ebeaeda4
|
@ -121,8 +121,6 @@ static struct option long_options[] =
|
||||||
/* variable for readline support */
|
/* variable for readline support */
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
static const int have_rl = 1;
|
static const int have_rl = 1;
|
||||||
#else /* no readline */
|
|
||||||
static const int have_rl = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,6 +141,7 @@ int main(int argc, char *argv[])
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
int show_conf = 0;
|
int show_conf = 0;
|
||||||
int dump_caps_opt = 0;
|
int dump_caps_opt = 0;
|
||||||
|
|
||||||
#ifdef HAVE_READLINE_HISTORY
|
#ifdef HAVE_READLINE_HISTORY
|
||||||
int rd_hist = 0;
|
int rd_hist = 0;
|
||||||
int sv_hist = 0;
|
int sv_hist = 0;
|
||||||
|
@ -150,7 +149,8 @@ int main(int argc, char *argv[])
|
||||||
const char hist_file[] = "/.rigctl_history";
|
const char hist_file[] = "/.rigctl_history";
|
||||||
char *hist_path = NULL;
|
char *hist_path = NULL;
|
||||||
struct stat hist_dir_stat;
|
struct stat hist_dir_stat;
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
|
|
||||||
const char *rig_file = NULL, *ptt_file = NULL, *dcd_file = NULL;
|
const char *rig_file = NULL, *ptt_file = NULL, *dcd_file = NULL;
|
||||||
ptt_type_t ptt_type = RIG_PTT_NONE;
|
ptt_type_t ptt_type = RIG_PTT_NONE;
|
||||||
dcd_type_t dcd_type = RIG_DCD_NONE;
|
dcd_type_t dcd_type = RIG_DCD_NONE;
|
||||||
|
@ -389,7 +389,7 @@ int main(int argc, char *argv[])
|
||||||
case 'I':
|
case 'I':
|
||||||
sv_hist++;
|
sv_hist++;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose++;
|
verbose++;
|
||||||
|
@ -570,7 +570,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LIBREADLINE */
|
#endif /* HAVE_LIBREADLINE */
|
||||||
|
@ -608,11 +608,11 @@ int main(int argc, char *argv[])
|
||||||
hist_path = (char *)NULL;
|
hist_path = (char *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_LIBREADLINE */
|
||||||
rig_close(my_rig); /* close port */
|
rig_close(my_rig); /* close port */
|
||||||
rig_cleanup(my_rig); /* if you care about memory */
|
rig_cleanup(my_rig); /* if you care about memory */
|
||||||
|
|
||||||
return exitcode;
|
return exitcode;
|
||||||
|
|
|
@ -109,8 +109,6 @@ static struct option long_options[] =
|
||||||
/* variable for readline support */
|
/* variable for readline support */
|
||||||
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
||||||
static const int have_rl = 1;
|
static const int have_rl = 1;
|
||||||
#else /* no readline */
|
|
||||||
static const int have_rl = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,6 +129,7 @@ int main(int argc, char *argv[])
|
||||||
int verbose = 0;
|
int verbose = 0;
|
||||||
int show_conf = 0;
|
int show_conf = 0;
|
||||||
int dump_caps_opt = 0;
|
int dump_caps_opt = 0;
|
||||||
|
|
||||||
#ifdef HAVE_READLINE_HISTORY
|
#ifdef HAVE_READLINE_HISTORY
|
||||||
int rd_hist = 0;
|
int rd_hist = 0;
|
||||||
int sv_hist = 0;
|
int sv_hist = 0;
|
||||||
|
@ -138,7 +137,8 @@ int main(int argc, char *argv[])
|
||||||
const char hist_file[] = "/.rotctl_history";
|
const char hist_file[] = "/.rotctl_history";
|
||||||
char *hist_path = NULL;
|
char *hist_path = NULL;
|
||||||
struct stat hist_dir_stat;
|
struct stat hist_dir_stat;
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
|
|
||||||
const char *rot_file = NULL;
|
const char *rot_file = NULL;
|
||||||
int serial_rate = 0;
|
int serial_rate = 0;
|
||||||
char conf_parms[MAXCONFLEN] = "";
|
char conf_parms[MAXCONFLEN] = "";
|
||||||
|
@ -240,7 +240,7 @@ int main(int argc, char *argv[])
|
||||||
case 'I':
|
case 'I':
|
||||||
sv_hist++;
|
sv_hist++;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
|
|
||||||
case 'v':
|
case 'v':
|
||||||
verbose++;
|
verbose++;
|
||||||
|
@ -395,7 +395,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LIBREADLINE */
|
#endif /* HAVE_LIBREADLINE */
|
||||||
|
@ -433,11 +433,11 @@ int main(int argc, char *argv[])
|
||||||
hist_path = (char *)NULL;
|
hist_path = (char *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_READLINE_HISTORY */
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* HAVE_LIBREADLINE */
|
||||||
rot_close(my_rot); /* close port */
|
rot_close(my_rot); /* close port */
|
||||||
rot_cleanup(my_rot); /* if you care about memory */
|
rot_cleanup(my_rot); /* if you care about memory */
|
||||||
|
|
||||||
return exitcode;
|
return exitcode;
|
||||||
|
|
Ładowanie…
Reference in New Issue