On Sat, 30 Apr 2011, Denys Vlasenko wrote:
> On Saturday 30 April 2011 18:34, Cristian Ionescu-Idbohrn wrote:
> > dist: debian unstable (aka sid)
> > gcc-4.6.real (Debian 4.6.0-6) 4.6.1 20110428 (prerelease)
> > BusyBox v1.19.0.git (2011-04-30 18:22:26 CEST) multi-call binary.
> >
> > I'd like to understand what's going on, why, and what I can do about it:
> >
> > HOSTCC scripts/kconfig/conf.o
> > scripts/kconfig/conf.c: In function 'conf_string':
> > scripts/kconfig/conf.c:176:20: warning: variable 'help' set but not used
> > [-Wunused-but-set-variable]
>
> Above, variable "help" is not used and can be deleted.
> You can send a patch which fixes it.
Alright. See attached patch proposals.
3 + 2 + 1 warnings may now be gone, half a gazillion still lurking around ;)
Cheers,
--
Cristian
commit 5c053fb342f465a1a822c5588ff6c9dcea221a4d
Author: Cristian Ionescu-Idbohrn <[email protected]>
Date: Sun May 1 09:59:28 2011 +0200
Ignoring another generated file.
Signed-off-by: Cristian Ionescu-Idbohrn <[email protected]>
diff --git a/.gitignore b/.gitignore
index 7d2cca6..0a0c65b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ Config.in
# Normal output
#
/busybox
+/busybox_old
/busybox_unstripped*
#
commit 20edb13702c9ff49cea3915ec66f00b1f241ef4c
Author: Cristian Ionescu-Idbohrn <[email protected]>
Date: Sun May 1 09:54:30 2011 +0200
These 3 warnings are no more:
scripts/kconfig/conf.c: In function 'conf_string':
scripts/kconfig/conf.c:176:20: warning: variable 'help' set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c: In function 'conf_sym':
scripts/kconfig/conf.c:210:6: warning: variable 'type' set but not used [-Wunused-but-set-variable]
scripts/kconfig/conf.c: In function 'conf_choice':
scripts/kconfig/conf.c:285:6: warning: variable 'type' set but not used [-Wunused-but-set-variable]
Signed-off-by: Cristian Ionescu-Idbohrn <[email protected]>
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 6e09788..ea2446a 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -173,7 +173,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
int conf_string(struct menu *menu)
{
struct symbol *sym = menu->sym;
- const char *def, *help;
+ const char *def;
while (1) {
printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -188,10 +188,7 @@ int conf_string(struct menu *menu)
case '?':
/* print help */
if (line[1] == '\n') {
- help = nohelp_text;
- if (menu->sym->help)
- help = menu->sym->help;
- printf("\n%s\n", menu->sym->help);
+ printf("\n%s\n", menu->sym->help ? menu->sym->help : nohelp_text);
def = NULL;
break;
}
@@ -207,7 +204,6 @@ int conf_string(struct menu *menu)
static int conf_sym(struct menu *menu)
{
struct symbol *sym = menu->sym;
- int type;
tristate oldval, newval;
const char *help;
@@ -215,7 +211,6 @@ static int conf_sym(struct menu *menu)
printf("%*s%s ", indent - 1, "", menu->prompt->text);
if (sym->name)
printf("(%s) ", sym->name);
- type = sym_get_type(sym);
putchar('[');
oldval = sym_get_tristate_value(sym);
switch (oldval) {
@@ -282,11 +277,9 @@ static int conf_choice(struct menu *menu)
{
struct symbol *sym, *def_sym;
struct menu *child;
- int type;
bool is_new;
sym = menu->sym;
- type = sym_get_type(sym);
is_new = !sym_has_value(sym);
if (sym_is_changable(sym)) {
conf_sym(menu);
commit 5d2d9f505f9d86cd898d43b0751342164fa0c3cf
Author: Cristian Ionescu-Idbohrn <[email protected]>
Date: Sun May 1 10:20:27 2011 +0200
Another 2 warnings gone:
scripts/kconfig/lxdialog/textbox.c: In function 'print_line':
scripts/kconfig/lxdialog/textbox.c:440:9: warning: variable 'x' set but not used [-Wunused-but-set-variable]
scripts/kconfig/lxdialog/textbox.c:440:6: warning: variable 'y' set but not used [-Wunused-but-set-variable]
Signed-off-by: Cristian Ionescu-Idbohrn <[email protected]>
diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c
index 77848bb..72cda3d 100644
--- a/scripts/kconfig/lxdialog/textbox.c
+++ b/scripts/kconfig/lxdialog/textbox.c
@@ -437,7 +437,6 @@ static void print_page(WINDOW * win, int height, int width)
*/
static void print_line(WINDOW * win, int row, int width)
{
- int y, x;
char *line;
line = get_line();
@@ -446,11 +445,13 @@ static void print_line(WINDOW * win, int row, int width)
waddch(win, ' ');
waddnstr(win, line, MIN(strlen(line), width - 2));
- getyx(win, y, x);
/* Clear 'residue' of previous line */
#if OLD_NCURSES
{
int i;
+ int y, x;
+
+ getyx(win, y, x);
for (i = 0; i < width - x; i++)
waddch(win, ' ');
}
commit cb260d8502360ff3db0871564bae2c10da9272c7
Author: Cristian Ionescu-Idbohrn <[email protected]>
Date: Sun May 1 10:28:00 2011 +0200
Attempt to nuke another one of those warnings:
scripts/kconfig/lxdialog/textbox.c: In function 'dialog_textbox':
scripts/kconfig/lxdialog/textbox.c:41:7: warning: variable 'search_term' set but not used [-Wunused-but-set-variable]
Variable 'search_term' found only here:
scripts/kconfig/lxdialog/textbox.c: char search_term[MAX_LEN + 1];
scripts/kconfig/lxdialog/textbox.c: search_term[0] = '\0'; /* no search term entered yet */
Signed-off-by: Cristian Ionescu-Idbohrn <[email protected]>
diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c
index 72cda3d..de4ae41 100644
--- a/scripts/kconfig/lxdialog/textbox.c
+++ b/scripts/kconfig/lxdialog/textbox.c
@@ -38,11 +38,8 @@ int dialog_textbox(const char *title, const char *file, int height, int width)
{
int i, x, y, cur_x, cur_y, fpos, key = 0;
int passed_end;
- char search_term[MAX_LEN + 1];
WINDOW *dialog, *text;
- search_term[0] = '\0'; /* no search term entered yet */
-
/* Open input file for reading */
if ((fd = open(file, O_RDONLY)) == -1) {
endwin();
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox