提交 7826005e 编写于 作者: S Sam Ravnborg

kconfig: improve error messages for bad source statements

We now say where we detect the second source of a file,
and where we detect a recursively source of the same file.
This makes it easier to fix such errors.
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
上级 cf82607a
...@@ -2370,11 +2370,14 @@ void zconf_nextfile(const char *name) ...@@ -2370,11 +2370,14 @@ void zconf_nextfile(const char *name)
current_buf = buf; current_buf = buf;
if (file->flags & FILE_BUSY) { if (file->flags & FILE_BUSY) {
printf("recursive scan (%s)?\n", name); printf("%s:%d: do not source '%s' from itself\n",
zconf_curname(), zconf_lineno(), name);
exit(1); exit(1);
} }
if (file->flags & FILE_SCANNED) { if (file->flags & FILE_SCANNED) {
printf("file %s already scanned?\n", name); printf("%s:%d: file '%s' is already sourced from '%s'\n",
zconf_curname(), zconf_lineno(), name,
file->parent->name);
exit(1); exit(1);
} }
file->flags |= FILE_BUSY; file->flags |= FILE_BUSY;
......
...@@ -314,11 +314,14 @@ void zconf_nextfile(const char *name) ...@@ -314,11 +314,14 @@ void zconf_nextfile(const char *name)
current_buf = buf; current_buf = buf;
if (file->flags & FILE_BUSY) { if (file->flags & FILE_BUSY) {
printf("recursive scan (%s)?\n", name); printf("%s:%d: do not source '%s' from itself\n",
zconf_curname(), zconf_lineno(), name);
exit(1); exit(1);
} }
if (file->flags & FILE_SCANNED) { if (file->flags & FILE_SCANNED) {
printf("file %s already scanned?\n", name); printf("%s:%d: file '%s' is already sourced from '%s'\n",
zconf_curname(), zconf_lineno(), name,
file->parent->name);
exit(1); exit(1);
} }
file->flags |= FILE_BUSY; file->flags |= FILE_BUSY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册