Skip to content

Commit 6971f71

Browse files
committed
kconfig: remove zconfprint()
Turn all warnings during parsing into hard errors. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent bea2c5e commit 6971f71

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

scripts/kconfig/parser.y

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
int cdebug = PRINTD;
2525

2626
static void yyerror(const char *err);
27-
static void zconfprint(const char *err, ...);
2827
static void zconf_error(const char *err, ...);
2928
static bool zconf_endtoken(const char *tokenname,
3029
const char *expected_tokenname);
@@ -183,7 +182,7 @@ menuconfig_stmt: menuconfig_entry_start config_option_list
183182
if (current_entry->prompt)
184183
current_entry->prompt->type = P_MENU;
185184
else
186-
zconfprint("warning: menuconfig statement without prompt");
185+
zconf_error("menuconfig statement without prompt");
187186
printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);
188187
};
189188

@@ -402,14 +401,14 @@ help: help_start T_HELPTEXT
402401
{
403402
if (current_entry->help) {
404403
free(current_entry->help);
405-
zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used",
406-
current_entry->sym->name ?: "<choice>");
404+
zconf_error("'%s' defined with more than one help text",
405+
current_entry->sym->name ?: "<choice>");
407406
}
408407

409408
/* Is the help text empty or all whitespace? */
410409
if ($2[strspn($2, " \f\n\r\t\v")] == '\0')
411-
zconfprint("warning: '%s' defined with blank help text",
412-
current_entry->sym->name ?: "<choice>");
410+
zconf_error("'%s' defined with blank help text",
411+
current_entry->sym->name ?: "<choice>");
413412

414413
current_entry->help = $2;
415414
};
@@ -592,17 +591,6 @@ static bool zconf_endtoken(const char *tokenname,
592591
return true;
593592
}
594593

595-
static void zconfprint(const char *err, ...)
596-
{
597-
va_list ap;
598-
599-
fprintf(stderr, "%s:%d: ", cur_filename, cur_lineno);
600-
va_start(ap, err);
601-
vfprintf(stderr, err, ap);
602-
va_end(ap);
603-
fprintf(stderr, "\n");
604-
}
605-
606594
static void zconf_error(const char *err, ...)
607595
{
608596
va_list ap;

0 commit comments

Comments
 (0)