[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <boris.20201221161803@codesynthesis.com>
Date: Mon, 21 Dec 2020 16:22:53 +0200
From: Boris Kolpackov <boris@...esynthesis.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, Jonathan Corbet <corbet@....net>,
Michal Marek <michal.lkml@...kovi.net>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kconfig: drop filename and line number prefix from
warning/error-if macros
[Copying some of my comments from another reply.]
Masahiro Yamada <masahiroy@...nel.org> writes:
> When I implemented the Kconfig macro language, I took the GNU Make
> behavior as a reference in general, but I did not follow the message
> format of $(error ...) to avoid that annoyance.
>
> So, the following code in Kconfig:
>
> $(warning-if,y,This is the first line)
> $(warning-if,y,This is the second line)
> $(error-if,y,This is the last line)
>
> ... will print the messages in a consistent format:
>
> Kconfig:1: This is the first line
> Kconfig:2: This is the second line
> Kconfig:3: This is the last line
IMO, there is a flaw with this approach: there is no way for the
user to know that these three lines are about the same error.
If we want this ability, then let's find a way do it properly
rather than spreading further hacks. For example, in the build
system I am working on, we have suport for multi-line diagnostics
records that to the user look like this:
Makefile:3: error: This is the first line
This is the second line
This is the last line
> But, in hindsight, the built-in functions should have only primitive
> functionality to print the given message without any prefix. The lesson
> I learned from GNU Make was such a prefix is easy to add, difficult to
> remove.
>
> This commit changes the built-in functions, warning-if and error-if, to
> not print the file name or the line number.
Wouldn't automatically showing the position in the Kconfig file
where the error/warning has originated be much, much more useful
than the occasional need to print multi-line messages?
Powered by blists - more mailing lists