Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kconfig: turn missing prompt for choice members into error

Choice members must have a prompt; hence make it an error.

While I was here, I moved the check to the parser to slim down
_menu_finalize().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+14 -2
-2
scripts/kconfig/menu.c
··· 507 507 menu->sym && !sym_is_choice_value(menu->sym)) { 508 508 current_entry = menu; 509 509 menu->sym->flags |= SYMBOL_CHOICEVAL; 510 - if (!menu->prompt) 511 - menu_warn(menu, "choice value must have a prompt"); 512 510 for (prop = menu->sym->prop; prop; prop = prop->next) { 513 511 if (prop->type == P_DEFAULT) 514 512 prop_warn(prop, "defaults for choice "
+14
scripts/kconfig/parser.y
··· 30 30 31 31 struct menu *current_menu, *current_entry; 32 32 33 + static bool inside_choice = false; 34 + 33 35 %} 34 36 35 37 %union ··· 147 145 148 146 config_stmt: config_entry_start config_option_list 149 147 { 148 + if (inside_choice) { 149 + if (!current_entry->prompt) { 150 + fprintf(stderr, "%s:%d: error: choice member must have a prompt\n", 151 + current_entry->filename, current_entry->lineno); 152 + yynerrs++; 153 + } 154 + } 155 + 150 156 printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno); 151 157 }; 152 158 ··· 247 237 } 248 238 249 239 $$ = menu_add_menu(); 240 + 241 + inside_choice = true; 250 242 }; 251 243 252 244 choice_end: end 253 245 { 246 + inside_choice = false; 247 + 254 248 if (zconf_endtoken($1, "choice")) { 255 249 menu_end_menu(); 256 250 printd(DEBUG_PARSE, "%s:%d:endchoice\n", cur_filename, cur_lineno);