From patchwork Tue Mar 13 09:56:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131424 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp517589ljb; Tue, 13 Mar 2018 02:57:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELscE6qlb8tQ5l4DPvnnSljCeM1DXyLaB+uE0GxbJc6opB0fkD7f2E+Ryc4Y9DSc2P9NEbg4 X-Received: by 10.99.180.2 with SMTP id s2mr10760pgf.26.1520935072926; Tue, 13 Mar 2018 02:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520935072; cv=none; d=google.com; s=arc-20160816; b=nzSPU6NTdZYt72zO6pjoD7EuLJ3kx/Sm2FeBiioJd1GnFhmFZ/gmomoQCxlbIIVrsk ru4S+4noZtkEFZ8cFyqpb/Ywj2Opw6RGkMj3yglfQOrhO7cJH82a1wC6jx+SbDtSBxNh uUYRL8EuBHK6aqqn+pIPwLpHIQGye0dXoZD5l+kK4+dv+mlq7bEsu6C/4y7JV/sSkgQh 1V2KuUwXul+YGZfnR1XNYYSWLJXfkT4kF1o1msFMeQBbjgxpXnnBuRnqKoTEWlJUGHIF 7ugCOFwPfiQqA0GQxDuZUXw1A8TnotgGP4kXnAsxVt5EHQb8kOOwmQNPQPwcLCjvoykz 1cnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=fQuAEvhlo/wuLU7jSpavZyQyI0O8dDjtbghFHlgecfM=; b=u/bR46jKlwKfo1Zm2JTVjr2uR2qm025J2qSVcGiyeIwK/p4yEg6C9GMLGhUq3llqpt qHtCQAMlckQ/PDeyQn7c6zf/b1tQDjrpkudd3/rqH85oWkzP++m/fGyf2iMCjhfLqeuv 0QSolMCY3tjsZ/in9VFxmu5Xc1kDNT2Z5T9hb3O2Cnq04QyE/q/QvOCApDqGhKT/CQEI CTa+e+KRzFrxOXKXcw5o2Cn4p6Vq5MpTnQPa4VSNBnw+PjAJnI3KcjLUEx9QoEU+ddri v9lUCQefPFA/YWU6ThB/xdgwO+KOB90ZiueCiLtyLpkgu+0kWXDB29G3NI0RqhbDmSYs kClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oBC8BAjk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si6343589pgd.345.2018.03.13.02.57.52; Tue, 13 Mar 2018 02:57:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oBC8BAjk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654AbeCMJ5u (ORCPT + 28 others); Tue, 13 Mar 2018 05:57:50 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:57996 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbeCMJ5o (ORCPT ); Tue, 13 Mar 2018 05:57:44 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2D9uEJw021254; Tue, 13 Mar 2018 18:56:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2D9uEJw021254 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1520934974; bh=fQuAEvhlo/wuLU7jSpavZyQyI0O8dDjtbghFHlgecfM=; h=From:To:Cc:Subject:Date:From; b=oBC8BAjkHmmg+1/rhkVm4G4O/WyXGeoq+0JdmtfASv7X5aQtfN9el+4wm3usmh7cm rB9E9w2a3m0s3/pKBOwTeuCQ8Jl9yQ5jikeIRyUMErWlMzVML4PL3pZZ5wdfoQ73+d 2e+ypCYJ2YxAYNLhQMBTpu98lFybE8//wTtmCvaKXEp5q1d/xFqtLRRDD1OIG6gKne GzPFmQmCStH81b7/EIkqd6uaVZRsfRd6pOLExxgfRlJhUihCLlgTxZvGnn6yW591Z+ SKOw+XHL1WfLqjlxsEM3Jq6EacXhzCTVyTzVcQ04w3QAQvaiBKih3Sil8JZXtM0toO auQFpCKDSbX7g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Eugeniu Rosca , Randy Dunlap , "Luis R . Rodriguez" , Petr Vorel , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v4 1/2] kconfig: warn unmet direct dependency of tristate symbols selected by y Date: Tue, 13 Mar 2018 18:56:07 +0900 Message-Id: <1520934968-30406-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 246cf9c26bf1 ("kbuild: Warn on selecting symbols with unmet direct dependencies") forcibly promoted ->dir_dep.tri to yes from mod. So, the unmet direct dependencies of tristate symbols are not reported. [Test Case] config MODULES def_bool y option modules config A def_bool y select B config B tristate "B" depends on m This causes unmet dependency because 'B' is forced 'y' ignoring 'depends on m'. This should be warned. On the other hand, the following case ('B' is bool) should not be warned, so 'depends on m' for bool symbols should be naturally treated as 'depends on y'. [Test Case2 (not unmet dependency)] config MODULES def_bool y option modules config A def_bool y select B config B bool "B" depends on m Signed-off-by: Masahiro Yamada --- Changes in v4: - newly added scripts/kconfig/symbol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 0f7eba7..def860b 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -243,7 +243,7 @@ static void sym_calc_visibility(struct symbol *sym) tri = yes; if (sym->dir_dep.expr) tri = expr_calc_value(sym->dir_dep.expr); - if (tri == mod) + if (sym->type == S_BOOLEAN && tri == mod) tri = yes; if (sym->dir_dep.tri != tri) { sym->dir_dep.tri = tri; @@ -414,7 +414,7 @@ void sym_calc_value(struct symbol *sym) } } calc_newval: - if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { + if (sym->dir_dep.tri < sym->rev_dep.tri) { struct expr *e; e = expr_simplify_unmet_dep(sym->rev_dep.expr, sym->dir_dep.expr); From patchwork Tue Mar 13 09:56:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131425 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp517769ljb; Tue, 13 Mar 2018 02:58:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELvb+RgsIfmJ/PEU7m/+BRM7+jqELvFc29lpHjEIKF6wuNCCYtCiIxrLtYEJ7368HMnC1vDq X-Received: by 2002:a17:902:bc41:: with SMTP id t1-v6mr12897plz.56.1520935086932; Tue, 13 Mar 2018 02:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520935086; cv=none; d=google.com; s=arc-20160816; b=ic8PmhlRbGRvXsNVh4TkQSZr+yzRrykBVmlEMT9ZzjGxtsG251w0qK19mPXs8nW+Qb BZU/mgV0ekCHjLmNTk6UY+pETxDqjOteE6058z/DY6B7aVBfWgfoJEJJMHdrFD6oYXS+ v5S68rr0NlYz6fPQgy0RBrPmP6uzZ+yzXxgucFdsedymjC5d9HgxZlt5Fc2kY5JB3dgj E+P/QM4wdhgvyGs2AV9lKK7JQFMzYdS+HiE+CFNu0uKW4e3+BZLQ70HZMqVOrDhM/eIJ L2LlExGl1jNfyl/VrwcCN9nrg4NwG73IuJTXhj+fOH+v4hjIr3Wfdz3wZ2trdALqs6iP Vz7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=yrZMJgA+XqLIaVqElB7+BlrS8BeG+fJiL+a1gIIqcpQ=; b=UEJAtQRivj8rJfXgnQCcQetYLtuCVIjEAb8S3L55YzUP0nyqQpAYl3SB+YAD+qN6C/ 092ve68p69oASiIg2gHzkcg55uFGo4Wjaz8bKYVLLVlCPBcVLmjvuDVUkh6SRsIlLpUE EOjfFsagvZuRl10l0e4BKOqsiET6PpRKqff+ct/Gh6AplFw+/OPlogYiMnVXZjPSUUU/ ZFc9zHZ4Pw/rfca1kj2Jogk/NqKPOkpA0SzrtNtSwMHBbAS7K8uaQmkMXsHTKUNhIw8v PngwHKH08QU0+uY1B6mc4krw/7bDd3X4DqnM3PYZgqdpzwb11ho4GGgYwr/LV2HZVzos Y7HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=d0le0sn6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b59-v6si7621513plb.529.2018.03.13.02.58.06; Tue, 13 Mar 2018 02:58:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=d0le0sn6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbeCMJ5s (ORCPT + 28 others); Tue, 13 Mar 2018 05:57:48 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:57997 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254AbeCMJ5o (ORCPT ); Tue, 13 Mar 2018 05:57:44 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2D9uEJx021254; Tue, 13 Mar 2018 18:56:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2D9uEJx021254 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1520934975; bh=yrZMJgA+XqLIaVqElB7+BlrS8BeG+fJiL+a1gIIqcpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d0le0sn6PdlYZ0JcexQz7w76Uocv+jnYowNH19Sv+zAxkNHQa4CpWUiT8hBE0uEpV I32v+JjE1YZsdTUc5PvwbujeBRFmFpI1WL2v16Pgfw/lKnbIpi7tlHiR9E2kOT2Foc 0J3fJZmc4pnIW3joUWmihGEMRB0WUD7Wea4bI3MFBET7Qh9g2bZRn9Kfo5h+5tMFFU CYQ4PES7b6y030jY4qvFf7QVzY3HnP73kLv5Z9zcw9V0hptmpNQBYLKRRhEoSP0pWB cIO5qceECcnx2hs9RFZh62IrCatouQm7XKBCwRDzyrckKrcoQIgUhU6HooEHRUlEVb EIBuvDNaNYUUA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Ulf Magnusson , Eugeniu Rosca , Randy Dunlap , "Luis R . Rodriguez" , Petr Vorel , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] kconfig: make unmet dependency warnings readable Date: Tue, 13 Mar 2018 18:56:08 +0900 Message-Id: <1520934968-30406-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520934968-30406-1-git-send-email-yamada.masahiro@socionext.com> References: <1520934968-30406-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the unmet dependency warnings end up with endlessly long expressions, most of which are false positives. Here is test code to demonstrate how it currently works. [Test Case] config DEP1 def_bool y config DEP2 bool "DEP2" config A bool "A" select E config B bool "B" depends on DEP2 select E config C bool "C" depends on DEP1 && DEP2 select E config D def_bool n select E config E bool depends on DEP1 && DEP2 [Result] $ make config scripts/kconfig/conf --oldaskconfig Kconfig * * Linux Kernel Configuration * DEP2 (DEP2) [N/y/?] (NEW) n A (A) [N/y/?] (NEW) y warning: (A && B && D) selects E which has unmet direct dependencies (DEP1 && DEP2) Here, I see some points to be improved. First, '(A || B || D)' would make more sense than '(A && B && D)'. I am not sure if this is intentional, but expr_simplify_unmet_dep() turns OR expressions into AND, like follows: case E_OR: return expr_alloc_and( Second, we see false positives. 'A' is a real unmet dependency. 'B' is false positive because 'DEP1' is fixed to 'y', and 'B' depends on 'DEP2'. 'C' was correctly dropped by expr_simplify_unmet_dep(). 'D' is also false positive because it has no chance to be enabled. Current expr_simplify_unmet_dep() cannot avoid those false positives. After all, I decided to use the same helpers as used for printing reverse dependencies in the help. With this commit, unreadable warnings (most of the reported symbols are false positives) in the real world: $ make ARCH=score allyesconfig scripts/kconfig/conf --allyesconfig Kconfig warning: (HWSPINLOCK_QCOM && AHCI_MTK && STMMAC_PLATFORM && DWMAC_IPQ806X && DWMAC_LPC18XX && DWMAC_OXNAS && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI && TI_CPSW && PINCTRL_GEMINI && PINCTRL_OXNAS && PINCTRL_ROCKCHIP && PINCTRL_DOVE && PINCTRL_ARMADA_37XX && PINCTRL_STM32 && S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && COMMON_CLK_GEMINI && COMMON_CLK_ASPEED && COMMON_CLK_NXP && COMMON_CLK_OXNAS && COMMON_CLK_BOSTON && QCOM_ADSP_PIL && QCOM_Q6V5_PIL && QCOM_GSBI && ATMEL_EBI && ST_IRQCHIP && RESET_IMX7 && PHY_HI6220_USB && PHY_RALINK_USB && PHY_ROCKCHIP_PCIE && PHY_DA8XX_USB) selects MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM) warning: (PINCTRL_AT91 && PINCTRL_AT91PIO4 && PINCTRL_OXNAS && PINCTRL_PISTACHIO && PINCTRL_PIC32 && PINCTRL_MESON && PINCTRL_NOMADIK && PINCTRL_MTK && PINCTRL_MT7622 && GPIO_TB10X) selects OF_GPIO which has unmet direct dependencies (GPIOLIB && OF && HAS_IOMEM) warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && LOCKDEP) selects FRAME_POINTER which has unmet direct dependencies (DEBUG_KERNEL && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS) will be turned into: $ make ARCH=score allyesconfig scripts/kconfig/conf --allyesconfig Kconfig WARNING: unmet direct dependencies detected for MFD_SYSCON Depends on [n]: HAS_IOMEM [=n] Selected by [y]: - PINCTRL_STM32 [=y] && PINCTRL [=y] && (ARCH_STM32 || COMPILE_TEST [=y]) && OF [=y] - RTC_DRV_AT91SAM9 [=y] && RTC_CLASS [=y] && (ARCH_AT91 || COMPILE_TEST [=y]) - RESET_IMX7 [=y] && RESET_CONTROLLER [=y] - PHY_HI6220_USB [=y] && (ARCH_HISI && ARM64 || COMPILE_TEST [=y]) - PHY_RALINK_USB [=y] && (RALINK || COMPILE_TEST [=y]) - PHY_ROCKCHIP_PCIE [=y] && (ARCH_ROCKCHIP && OF [=y] || COMPILE_TEST [=y]) WARNING: unmet direct dependencies detected for OF_GPIO Depends on [n]: GPIOLIB [=y] && OF [=y] && HAS_IOMEM [=n] Selected by [y]: - PINCTRL_MTK [=y] && PINCTRL [=y] && (ARCH_MEDIATEK || COMPILE_TEST [=y]) && OF [=y] - PINCTRL_MT7622 [=y] && PINCTRL [=y] && (ARCH_MEDIATEK || COMPILE_TEST [=y]) && OF [=y] && (ARM64 || COMPILE_TEST [=y]) WARNING: unmet direct dependencies detected for FRAME_POINTER Depends on [n]: DEBUG_KERNEL [=y] && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS [=n] Selected by [y]: - LATENCYTOP [=y] && DEBUG_KERNEL [=y] && STACKTRACE_SUPPORT [=y] && PROC_FS [=y] && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86 Signed-off-by: Masahiro Yamada Reviewed-by: Petr Vorel --- Changes in v4: - Rename sym_warn_unmet_dependency() to sym_warn_unmet_dep() - Shift "Depends on:" and "Selected by" to the right by one space - Display value of "Depends on". This can be '[m]' or '[n]'. Changes in v3: - Remove unused expr_get_leftmost_symbol() - Move error message to the same line as 'WARNING' - update test case Changes in v2: - update test case scripts/kconfig/expr.c | 42 ------------------------------------------ scripts/kconfig/expr.h | 1 - scripts/kconfig/symbol.c | 35 +++++++++++++++++++++++------------ 3 files changed, 23 insertions(+), 55 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 49376e1..e1a39e9 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -1137,48 +1137,6 @@ static int expr_compare_type(enum expr_type t1, enum expr_type t2) return 0; } -static inline struct expr * -expr_get_leftmost_symbol(const struct expr *e) -{ - - if (e == NULL) - return NULL; - - while (e->type != E_SYMBOL) - e = e->left.expr; - - return expr_copy(e); -} - -/* - * Given expression `e1' and `e2', returns the leaf of the longest - * sub-expression of `e1' not containing 'e2. - */ -struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2) -{ - struct expr *ret; - - switch (e1->type) { - case E_OR: - return expr_alloc_and( - expr_simplify_unmet_dep(e1->left.expr, e2), - expr_simplify_unmet_dep(e1->right.expr, e2)); - case E_AND: { - struct expr *e; - e = expr_alloc_and(expr_copy(e1), expr_copy(e2)); - e = expr_eliminate_dups(e); - ret = (!expr_eq(e, e1)) ? e1 : NULL; - expr_free(e); - break; - } - default: - ret = e1; - break; - } - - return expr_get_leftmost_symbol(ret); -} - void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken) diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 8dbf2a4..94a383b 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -305,7 +305,6 @@ struct expr *expr_transform(struct expr *e); int expr_contains_symbol(struct expr *dep, struct symbol *sym); bool expr_depends_symbol(struct expr *dep, struct symbol *sym); struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); -struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); void expr_fprint(struct expr *e, FILE *out); struct gstr; /* forward */ diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index def860b..9e7d742 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -333,6 +333,27 @@ static struct symbol *sym_calc_choice(struct symbol *sym) return def_sym; } +static void sym_warn_unmet_dep(struct symbol *sym) +{ + struct gstr gs = str_new(); + + str_printf(&gs, + "\nWARNING: unmet direct dependencies detected for %s\n", + sym->name); + str_printf(&gs, + " Depends on [%c]: ", + sym->dir_dep.tri == mod ? 'm' : 'n'); + expr_gstr_print(sym->dir_dep.expr, &gs); + str_printf(&gs, "\n"); + + expr_gstr_print_revdep(sym->rev_dep.expr, &gs, yes, + " Selected by [y]:\n"); + expr_gstr_print_revdep(sym->rev_dep.expr, &gs, mod, + " Selected by [m]:\n"); + + fputs(str_get(&gs), stderr); +} + void sym_calc_value(struct symbol *sym) { struct symbol_value newval, oldval; @@ -414,18 +435,8 @@ void sym_calc_value(struct symbol *sym) } } calc_newval: - if (sym->dir_dep.tri < sym->rev_dep.tri) { - struct expr *e; - e = expr_simplify_unmet_dep(sym->rev_dep.expr, - sym->dir_dep.expr); - fprintf(stderr, "warning: ("); - expr_fprint(e, stderr); - fprintf(stderr, ") selects %s which has unmet direct dependencies (", - sym->name); - expr_fprint(sym->dir_dep.expr, stderr); - fprintf(stderr, ")\n"); - expr_free(e); - } + if (sym->dir_dep.tri < sym->rev_dep.tri) + sym_warn_unmet_dep(sym); newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); } if (newval.tri == mod &&