All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Ying Sun <sunying@nj.iscas.ac.cn>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Siyuan Guo <zy21df106@buaa.edu.cn>,
	Randy Dunlap <rdunlap@infradead.org>,
	Jesse T <mr.bossman075@gmail.com>
Subject: Re: [PATCH] kconfig: add dependency warning print about invalid values in verbose mode
Date: Thu, 24 Aug 2023 09:47:47 +0900	[thread overview]
Message-ID: <20230824004747.GC3913@google.com> (raw)
In-Reply-To: <CAK7LNAQNk2MU=M5Q6GXtm34VyFcNOhVgw3UQ7Mdn4hoqQ_636A@mail.gmail.com>

On (23/08/24 06:52), Masahiro Yamada wrote:
> On Wed, Aug 23, 2023 at 10:56 AM Sergey Senozhatsky
> <senozhatsky@chromium.org> wrote:
> >
> > On (23/08/19 22:40), Jesse T wrote:
> > > > > From: Ying Sun <sunying@nj.iscas.ac.cn>
> > > > >
> > > > > Add warning about the configuration option's invalid value in verbose mode,
> > > > >  including error causes, mismatch dependency, old and new values,
> > > > >  to help users correct them.
> >
> > Are those really errors?
> >
> > ERROR : CLANG_VERSION[140006 => 0] value is invalid  due to it has default value
> > ERROR : CC_IS_GCC[n => y] value is invalid  due to it has default value
> > ERROR : GCC_VERSION[0 => 120200] value is invalid  due to it has default value
> >
> > I'm using clang, so corresponding options are set accordingly in my .config
> 
> 
> I think not errors, but warnings.

I agree.

Masahiro, do we really need "list missing" to be blocked on this?
This patch has been posted on Aug 8 and there was not much progress
since then. Can we, perhaps, move "list missing" forward?


---
 scripts/kconfig/confdata.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index fa2ae6f63352..bf6d473755aa 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -360,7 +360,10 @@ int conf_read_simple(const char *name, int def)
        char *p, *p2;
        struct symbol *sym;
        int i, def_flags;
+       bool missing = false;
+       const char *sanity_checks;
 
+       sanity_checks = getenv("KCONFIG_SANITY_CHECKS");
        if (name) {
                in = zconf_fopen(name);
        } else {
@@ -448,6 +451,13 @@ int conf_read_simple(const char *name, int def)
                        if (def == S_DEF_USER) {
                                sym = sym_find(line + 2 + strlen(CONFIG_));
                                if (!sym) {
+                                       if (sanity_checks) {
+                                               conf_warning("unknown symbol: %s",
+                                                            line + 2 + strlen(CONFIG_));
+                                               missing = true;
+                                               continue;
+                                       }
+
                                        conf_set_changed(true);
                                        continue;
                                }
@@ -482,6 +492,13 @@ int conf_read_simple(const char *name, int def)
 
                        sym = sym_find(line + strlen(CONFIG_));
                        if (!sym) {
+                               if (sanity_checks && def != S_DEF_AUTO) {
+                                       conf_warning("unknown symbol: %s",
+                                                    line + strlen(CONFIG_));
+                                       missing = true;
+                                       continue;
+                               }
+
                                if (def == S_DEF_AUTO)
                                        /*
                                         * Reading from include/config/auto.conf
@@ -530,6 +547,10 @@ int conf_read_simple(const char *name, int def)
        }
        free(line);
        fclose(in);
+
+       if (missing)
+               exit(1);
+
        return 0;
 }
 
-- 
2.42.0.rc1.204.g551eb34607-goog

  reply	other threads:[~2023-08-24  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  0:24 [PATCH] kconfig: add dependency warning print about invalid values in verbose mode sunying
2023-08-19 23:01 ` Masahiro Yamada
2023-08-20  2:40   ` Jesse T
2023-08-23  1:55     ` Sergey Senozhatsky
2023-08-23 21:52       ` Masahiro Yamada
2023-08-24  0:47         ` Sergey Senozhatsky [this message]
2023-08-29  7:49     ` 郭思远
2023-09-05  9:43 ` [PATCHv2 -next] " sunying
2023-11-02  2:50   ` 郭思远
2023-11-06  3:51     ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230824004747.GC3913@google.com \
    --to=senozhatsky@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mr.bossman075@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=sunying@nj.iscas.ac.cn \
    --cc=zy21df106@buaa.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.