diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-02-05 19:34:41 -0500 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-02-08 14:10:10 -0500 |
| commit | 9e3e10c725360b9d07018cfcd5b7b6b7d325fae5 (patch) | |
| tree | c3de9ca1974443fb36319e74ac0b7b893a3a39eb /scripts | |
| parent | f3ff6fb5db68bcd460e9880d5fb4902520dd645b (diff) | |
kconfig: send error messages to stderr
These messages should be directed to stderr.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/conf.c | 10 | ||||
| -rw-r--r-- | scripts/kconfig/expr.c | 4 | ||||
| -rw-r--r-- | scripts/kconfig/symbol.c | 2 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.l | 27 |
4 files changed, 24 insertions, 19 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index fe59f6df4b45..822dc51923d6 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -548,7 +548,7 @@ int main(int ac, char **av) | |||
| 548 | } | 548 | } |
| 549 | } | 549 | } |
| 550 | if (ac == optind) { | 550 | if (ac == optind) { |
| 551 | printf(_("%s: Kconfig file missing\n"), av[0]); | 551 | fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]); |
| 552 | conf_usage(progname); | 552 | conf_usage(progname); |
| 553 | exit(1); | 553 | exit(1); |
| 554 | } | 554 | } |
| @@ -573,9 +573,11 @@ int main(int ac, char **av) | |||
| 573 | if (!defconfig_file) | 573 | if (!defconfig_file) |
| 574 | defconfig_file = conf_get_default_confname(); | 574 | defconfig_file = conf_get_default_confname(); |
| 575 | if (conf_read(defconfig_file)) { | 575 | if (conf_read(defconfig_file)) { |
| 576 | printf(_("***\n" | 576 | fprintf(stderr, |
| 577 | "*** Can't find default configuration \"%s\"!\n" | 577 | _("***\n" |
| 578 | "***\n"), defconfig_file); | 578 | "*** Can't find default configuration \"%s\"!\n" |
| 579 | "***\n"), | ||
| 580 | defconfig_file); | ||
| 579 | exit(1); | 581 | exit(1); |
| 580 | } | 582 | } |
| 581 | break; | 583 | break; |
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 2ba332b3fed7..d45381986ac7 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c | |||
| @@ -94,7 +94,7 @@ struct expr *expr_copy(const struct expr *org) | |||
| 94 | e->right.expr = expr_copy(org->right.expr); | 94 | e->right.expr = expr_copy(org->right.expr); |
| 95 | break; | 95 | break; |
| 96 | default: | 96 | default: |
| 97 | printf("can't copy type %d\n", e->type); | 97 | fprintf(stderr, "can't copy type %d\n", e->type); |
| 98 | free(e); | 98 | free(e); |
| 99 | e = NULL; | 99 | e = NULL; |
| 100 | break; | 100 | break; |
| @@ -127,7 +127,7 @@ void expr_free(struct expr *e) | |||
| 127 | expr_free(e->right.expr); | 127 | expr_free(e->right.expr); |
| 128 | break; | 128 | break; |
| 129 | default: | 129 | default: |
| 130 | printf("how to free type %d?\n", e->type); | 130 | fprintf(stderr, "how to free type %d?\n", e->type); |
| 131 | break; | 131 | break; |
| 132 | } | 132 | } |
| 133 | free(e); | 133 | free(e); |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 13f7fdfe328d..c4409ee7fee2 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
| @@ -1221,7 +1221,7 @@ static struct symbol *sym_check_expr_deps(struct expr *e) | |||
| 1221 | default: | 1221 | default: |
| 1222 | break; | 1222 | break; |
| 1223 | } | 1223 | } |
| 1224 | printf("Oops! How to check %d?\n", e->type); | 1224 | fprintf(stderr, "Oops! How to check %d?\n", e->type); |
| 1225 | return NULL; | 1225 | return NULL; |
| 1226 | } | 1226 | } |
| 1227 | 1227 | ||
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 07e074dc68a1..0ba4900050c1 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
| @@ -184,7 +184,9 @@ n [A-Za-z0-9_-] | |||
| 184 | append_string(yytext, 1); | 184 | append_string(yytext, 1); |
| 185 | } | 185 | } |
| 186 | \n { | 186 | \n { |
| 187 | printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); | 187 | fprintf(stderr, |
| 188 | "%s:%d:warning: multi-line strings not supported\n", | ||
| 189 | zconf_curname(), zconf_lineno()); | ||
| 188 | current_file->lineno++; | 190 | current_file->lineno++; |
| 189 | BEGIN(INITIAL); | 191 | BEGIN(INITIAL); |
| 190 | return T_EOL; | 192 | return T_EOL; |
| @@ -294,7 +296,7 @@ void zconf_initscan(const char *name) | |||
| 294 | { | 296 | { |
| 295 | yyin = zconf_fopen(name); | 297 | yyin = zconf_fopen(name); |
| 296 | if (!yyin) { | 298 | if (!yyin) { |
| 297 | printf("can't find file %s\n", name); | 299 | fprintf(stderr, "can't find file %s\n", name); |
| 298 | exit(1); | 300 | exit(1); |
| 299 | } | 301 | } |
| 300 | 302 | ||
| @@ -315,8 +317,8 @@ void zconf_nextfile(const char *name) | |||
| 315 | current_buf->state = YY_CURRENT_BUFFER; | 317 | current_buf->state = YY_CURRENT_BUFFER; |
| 316 | yyin = zconf_fopen(file->name); | 318 | yyin = zconf_fopen(file->name); |
| 317 | if (!yyin) { | 319 | if (!yyin) { |
| 318 | printf("%s:%d: can't open file \"%s\"\n", | 320 | fprintf(stderr, "%s:%d: can't open file \"%s\"\n", |
| 319 | zconf_curname(), zconf_lineno(), file->name); | 321 | zconf_curname(), zconf_lineno(), file->name); |
| 320 | exit(1); | 322 | exit(1); |
| 321 | } | 323 | } |
| 322 | yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); | 324 | yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); |
| @@ -325,20 +327,21 @@ void zconf_nextfile(const char *name) | |||
| 325 | 327 | ||
| 326 | for (iter = current_file->parent; iter; iter = iter->parent ) { | 328 | for (iter = current_file->parent; iter; iter = iter->parent ) { |
| 327 | if (!strcmp(current_file->name,iter->name) ) { | 329 | if (!strcmp(current_file->name,iter->name) ) { |
| 328 | printf("%s:%d: recursive inclusion detected. " | 330 | fprintf(stderr, |
| 329 | "Inclusion path:\n current file : '%s'\n", | 331 | "%s:%d: recursive inclusion detected. " |
| 330 | zconf_curname(), zconf_lineno(), | 332 | "Inclusion path:\n current file : '%s'\n", |
| 331 | zconf_curname()); | 333 | zconf_curname(), zconf_lineno(), |
| 334 | zconf_curname()); | ||
| 332 | iter = current_file->parent; | 335 | iter = current_file->parent; |
| 333 | while (iter && \ | 336 | while (iter && \ |
| 334 | strcmp(iter->name,current_file->name)) { | 337 | strcmp(iter->name,current_file->name)) { |
| 335 | printf(" included from: '%s:%d'\n", | 338 | fprintf(stderr, " included from: '%s:%d'\n", |
| 336 | iter->name, iter->lineno-1); | 339 | iter->name, iter->lineno-1); |
| 337 | iter = iter->parent; | 340 | iter = iter->parent; |
| 338 | } | 341 | } |
| 339 | if (iter) | 342 | if (iter) |
| 340 | printf(" included from: '%s:%d'\n", | 343 | fprintf(stderr, " included from: '%s:%d'\n", |
| 341 | iter->name, iter->lineno+1); | 344 | iter->name, iter->lineno+1); |
| 342 | exit(1); | 345 | exit(1); |
| 343 | } | 346 | } |
| 344 | } | 347 | } |
