linux/scripts/kconfig
Masahiro Yamada 5ae6fcc4bb kconfig: fix line number in recursive inclusion error message
When recursive inclusion is detected, the line number of the last
'included from:' is wrong.

[Test Case]

Kconfig:
  -------->8--------
  source "Kconfig2"
  -------->8--------

Kconfig2:
  -------->8--------
  source "Kconfig3"
  -------->8--------

Kconfig3:
  -------->8--------
  source "Kconfig"
  -------->8--------

[Result]

  $ make allyesconfig
  scripts/kconfig/conf  --allyesconfig Kconfig
  Kconfig:1: recursive inclusion detected. Inclusion path:
    current file : 'Kconfig'
    included from: 'Kconfig3:1'
    included from: 'Kconfig2:1'
    included from: 'Kconfig:3'
  scripts/kconfig/Makefile:89: recipe for target 'allyesconfig' failed
  make[1]: *** [allyesconfig] Error 1
  Makefile:512: recipe for target 'allyesconfig' failed
  make: *** [allyesconfig] Error 2

where we expect

    current file : 'Kconfig'
    included from: 'Kconfig3:1'
    included from: 'Kconfig2:1'
    included from: 'Kconfig:1'

The 'iter->lineno+1' in the second fpinrtf() should be 'iter->lineno-1'.
I refactored the code to merge the two fprintf() calls.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-03 00:44:47 +09:00
..
lxdialog kconfig: Update ncurses package names for menuconfig 2018-03-02 09:20:57 +09:00
.gitignore
check.sh
conf.c
confdata.c kconfig: add xstrdup() helper 2018-03-02 00:26:47 +09:00
expr.c
expr.h
gconf.c
gconf.glade
images.c
kconf_id.c
kxgettext.c kconfig: add xstrdup() helper 2018-03-02 00:26:47 +09:00
list.h
lkc_proto.h
lkc.h kconfig: add xstrdup() helper 2018-03-02 00:26:47 +09:00
Makefile
mconf.c
menu.c kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list 2018-03-02 09:20:44 +09:00
merge_config.sh
nconf.c
nconf.gui.c
nconf.h
POTFILES.in
qconf.cc
qconf.h
streamline_config.pl
symbol.c kconfig: add xstrdup() helper 2018-03-02 00:26:47 +09:00
util.c kconfig: add xstrdup() helper 2018-03-02 00:26:47 +09:00
zconf.l kconfig: fix line number in recursive inclusion error message 2018-03-03 00:44:47 +09:00
zconf.y kconfig: Don't leak choice names during parsing 2018-03-02 09:20:55 +09:00