Skip to content

Commit e3b03bf

Browse files
committed
kconfig: display recursive dependency resolution hint just once
Commit 1c199f2 ("kbuild: document recursive dependency limitation / resolution") probably intended to show a hint along with "recursive dependency detected!" error, but it missed to add {...} guard, and the hint is displayed in every loop of the dep_stack traverse, annoyingly. This error was detected by GCC's -Wmisleading-indentation when switching to build-time generation of lexer/parser. scripts/kconfig/symbol.c: In function ‘sym_check_print_recursive’: scripts/kconfig/symbol.c:1150:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (stack->sym == last_sym) ^~ scripts/kconfig/symbol.c:1153:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"); ^~~~~~~ I could simply add {...} to surround the three fprintf(), but I rather chose to move the hint after the loop to make the whole message readable. Fixes: 1c199f2 ("kbuild: document recursive dependency limitation / resolution" Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Luis R. Rodriguez <[email protected]>
1 parent f77850d commit e3b03bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/kconfig/symbol.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
11501150
if (stack->sym == last_sym)
11511151
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
11521152
prop->file->name, prop->lineno);
1153-
fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
1154-
fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
1153+
11551154
if (stack->expr) {
11561155
fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
11571156
prop->file->name, prop->lineno,
@@ -1181,6 +1180,11 @@ static void sym_check_print_recursive(struct symbol *last_sym)
11811180
}
11821181
}
11831182

1183+
fprintf(stderr,
1184+
"For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"
1185+
"subsection \"Kconfig recursive dependency limitations\"\n"
1186+
"\n");
1187+
11841188
if (check_top == &cv_stack)
11851189
dep_stack_remove();
11861190
}

0 commit comments

Comments
 (0)