Skip to content

Commit 2d56030

Browse files
syntheticppmichal42
authored andcommitted
kconfig: Fix warning "‘jump’ may be used uninitialized"
Warning: In file included from scripts/kconfig/zconf.tab.c:2537:0: scripts/kconfig/menu.c: In function ‘get_symbol_str’: scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized] jump->offset = strlen(r->s); Simplifies the test logic because (head && local) means (jump != 0) and makes GCC happy when checking if the jump pointer was initialized. Signed-off-by: Peter Kümmel <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent a1e7b7b commit 2d56030

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/kconfig/menu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
548548
{
549549
int i, j;
550550
struct menu *submenu[8], *menu, *location = NULL;
551-
struct jump_key *jump;
551+
struct jump_key *jump = NULL;
552552

553553
str_printf(r, _("Prompt: %s\n"), _(prop->text));
554554
menu = prop->menu->parent;
@@ -586,7 +586,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
586586
str_printf(r, _(" Location:\n"));
587587
for (j = 4; --i >= 0; j += 2) {
588588
menu = submenu[i];
589-
if (head && location && menu == location)
589+
if (jump && menu == location)
590590
jump->offset = strlen(r->s);
591591
str_printf(r, "%*c-> %s", j, ' ',
592592
_(menu_get_prompt(menu)));

0 commit comments

Comments
 (0)