Commit 32a94b8b0c3e5ae575919850c5e49e936b704d45

Authored by Masahiro Yamada
1 parent 26561514cc

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>

Showing 2 changed files with 10 additions and 10 deletions Side-by-side Diff

scripts/kconfig/tests/err_recursive_inc/expected_stderr
1   -Kconfig.inc1:4: recursive inclusion detected. Inclusion path:
2   - current file : 'Kconfig.inc1'
3   - included from: 'Kconfig.inc3:1'
4   - included from: 'Kconfig.inc2:3'
5   - included from: 'Kconfig.inc1:4'
  1 +Recursive inclusion detected.
  2 +Inclusion path:
  3 + current file : Kconfig.inc1
  4 + included from: Kconfig.inc3:1
  5 + included from: Kconfig.inc2:3
  6 + included from: Kconfig.inc1:4
scripts/kconfig/zconf.l
... ... @@ -328,14 +328,13 @@
328 328 for (iter = current_file->parent; iter; iter = iter->parent ) {
329 329 if (!strcmp(current_file->name,iter->name) ) {
330 330 fprintf(stderr,
331   - "%s:%d: recursive inclusion detected. "
332   - "Inclusion path:\n current file : '%s'\n",
333   - zconf_curname(), zconf_lineno(),
334   - zconf_curname());
  331 + "Recursive inclusion detected.\n"
  332 + "Inclusion path:\n"
  333 + " current file : %s\n", zconf_curname());
335 334 iter = current_file;
336 335 do {
337 336 iter = iter->parent;
338   - fprintf(stderr, " included from: '%s:%d'\n",
  337 + fprintf(stderr, " included from: %s:%d\n",
339 338 iter->name, iter->lineno - 1);
340 339 } while (strcmp(iter->name, current_file->name));
341 340 exit(1);