提交 ec6452a5 编写于 作者: A Arnaud Lacombe 提交者: Michal Marek

kconfig: do not overwrite symbol direct dependency in assignment

Considering the following configuration:

config F
    bool "F"

choice AB
    bool "AB"
config A
    bool "A"
config B
    bool "B"
endchoice

if A
config D
    bool
    default y if F
    select E
config E
    bool "E"
endif

if B
config D
    bool
    default y if F
    select E
config E
    bool "E"
endif

The following configuration:

 CONFIG_F=y
 CONFIG_A=y
 # CONFIG_B is not set
 CONFIG_D=y
 CONFIG_E=y

emits a spurious warning:

(D) selects E which has unmet direct dependencies (B)

If a symbol appears in two different branch of the tree, it should inherit the
dependency of both parent, not just the last one.
Reported-by: NYann E. Morin <yann.morin.1998@anciens.enib.fr>
Tested-by: NYann E. Morin <yann.morin.1998@anciens.enib.fr>
Signed-off-by: NArnaud Lacombe <lacombar@gmail.com>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 36fee535
......@@ -351,7 +351,7 @@ void menu_finalize(struct menu *parent)
last_menu->next = NULL;
}
sym->dir_dep.expr = parent->dep;
sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
}
for (menu = parent->list; menu; menu = menu->next) {
if (sym && sym_is_choice(sym) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册