Skip to content

Commit

Permalink
kconfig: improve error messages for bad source statements
Browse files Browse the repository at this point in the history
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: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
  • Loading branch information
sravnborg committed Jan 2, 2009
1 parent cf82607 commit 7826005
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions scripts/kconfig/lex.zconf.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -2370,11 +2370,14 @@ void zconf_nextfile(const char *name)
current_buf = buf;

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);
}
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);
}
file->flags |= FILE_BUSY;
Expand Down
7 changes: 5 additions & 2 deletions scripts/kconfig/zconf.l
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,14 @@ void zconf_nextfile(const char *name)
current_buf = buf;

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);
}
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);
}
file->flags |= FILE_BUSY;
Expand Down

0 comments on commit 7826005

Please sign in to comment.