kconfig: check prompt for choice while parsing
This can be checked on-the-fly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
c33a4315c4
commit
4957515b9c
|
@ -561,9 +561,6 @@ void menu_finalize(struct menu *parent)
|
||||||
if (sym->type == S_UNKNOWN)
|
if (sym->type == S_UNKNOWN)
|
||||||
menu_warn(parent, "config symbol defined without type");
|
menu_warn(parent, "config symbol defined without type");
|
||||||
|
|
||||||
if (sym_is_choice(sym) && !parent->prompt)
|
|
||||||
menu_warn(parent, "choice must have a prompt");
|
|
||||||
|
|
||||||
/* Check properties connected to this symbol */
|
/* Check properties connected to this symbol */
|
||||||
sym_check_prop(sym);
|
sym_check_prop(sym);
|
||||||
sym->flags |= SYMBOL_WARNED;
|
sym->flags |= SYMBOL_WARNED;
|
||||||
|
|
|
@ -233,6 +233,12 @@ choice: T_CHOICE T_EOL
|
||||||
|
|
||||||
choice_entry: choice choice_option_list
|
choice_entry: choice choice_option_list
|
||||||
{
|
{
|
||||||
|
if (!current_entry->prompt) {
|
||||||
|
fprintf(stderr, "%s:%d: error: choice must have a prompt\n",
|
||||||
|
current_entry->filename, current_entry->lineno);
|
||||||
|
yynerrs++;
|
||||||
|
}
|
||||||
|
|
||||||
$$ = menu_add_menu();
|
$$ = menu_add_menu();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue