diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-22 13:00:12 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-03-25 13:04:06 -0400 |
commit | 32a94b8b0c3e5ae575919850c5e49e936b704d45 (patch) | |
tree | d3442edd51ead1e0345146b9e015358a199ced04 | |
parent | 26561514cc9defed09a043dfaedc900274b76ff2 (diff) |
kconfig: remove duplicated file name and lineno of recursive inclusion
As in the unit test, the error message for the recursive inclusion
looks like this:
Kconfig.inc1:4: recursive inclusion detected. Inclusion path:
current file : 'Kconfig.inc1'
included from: 'Kconfig.inc3:1'
included from: 'Kconfig.inc2:3'
included from: 'Kconfig.inc1:4'
The 'Kconfig.inc1:4' is duplicated in the first and last lines.
Also, the single quotes do not help readability.
Change the message like follows:
Recursive inclusion detected.
Inclusion path:
current file : Kconfig.inc1
included from: Kconfig.inc3:1
included from: Kconfig.inc2:3
included from: Kconfig.inc1:4
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | scripts/kconfig/tests/err_recursive_inc/expected_stderr | 11 | ||||
-rw-r--r-- | scripts/kconfig/zconf.l | 9 |
2 files changed, 10 insertions, 10 deletions
diff --git a/scripts/kconfig/tests/err_recursive_inc/expected_stderr b/scripts/kconfig/tests/err_recursive_inc/expected_stderr index a15dbedd253a..6b582eee2176 100644 --- a/scripts/kconfig/tests/err_recursive_inc/expected_stderr +++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr | |||
@@ -1,5 +1,6 @@ | |||
1 | Kconfig.inc1:4: recursive inclusion detected. Inclusion path: | 1 | Recursive inclusion detected. |
2 | current file : 'Kconfig.inc1' | 2 | Inclusion path: |
3 | included from: 'Kconfig.inc3:1' | 3 | current file : Kconfig.inc1 |
4 | included from: 'Kconfig.inc2:3' | 4 | included from: Kconfig.inc3:1 |
5 | included from: 'Kconfig.inc1:4' | 5 | included from: Kconfig.inc2:3 |
6 | included from: Kconfig.inc1:4 | ||
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 88b650eb9cc9..6f139d2dc65a 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l | |||
@@ -328,14 +328,13 @@ void zconf_nextfile(const char *name) | |||
328 | for (iter = current_file->parent; iter; iter = iter->parent ) { | 328 | for (iter = current_file->parent; iter; iter = iter->parent ) { |
329 | if (!strcmp(current_file->name,iter->name) ) { | 329 | if (!strcmp(current_file->name,iter->name) ) { |
330 | fprintf(stderr, | 330 | fprintf(stderr, |
331 | "%s:%d: recursive inclusion detected. " | 331 | "Recursive inclusion detected.\n" |
332 | "Inclusion path:\n current file : '%s'\n", | 332 | "Inclusion path:\n" |
333 | zconf_curname(), zconf_lineno(), | 333 | " current file : %s\n", zconf_curname()); |
334 | zconf_curname()); | ||
335 | iter = current_file; | 334 | iter = current_file; |
336 | do { | 335 | do { |
337 | iter = iter->parent; | 336 | iter = iter->parent; |
338 | fprintf(stderr, " included from: '%s:%d'\n", | 337 | fprintf(stderr, " included from: %s:%d\n", |
339 | iter->name, iter->lineno - 1); | 338 | iter->name, iter->lineno - 1); |
340 | } while (strcmp(iter->name, current_file->name)); | 339 | } while (strcmp(iter->name, current_file->name)); |
341 | exit(1); | 340 | exit(1); |