Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4188866pxu; Mon, 21 Dec 2020 06:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxX4LeWRlARDn1J2+6bci9kGKkbXbLKaXFeXNgwmpqClVnypdGJw9/dZP1OBpWvAB0mScq5 X-Received: by 2002:a05:6402:3048:: with SMTP id bu8mr16358191edb.49.1608560691630; Mon, 21 Dec 2020 06:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608560691; cv=none; d=google.com; s=arc-20160816; b=oqkWHb0Wf3smr1v6MEJiTJ93TJSZNVs7DqsXJ2t7HarxGvP2Kji+7uAr+ptXwxSke9 rZwGzqNYrQFstybXlVtVywrI62rEZcKlWitunkJZAV3erVH4RAzfGQikvYp1H8fE6d7s bjwYEj4GfPq0+b0jFeayOJ9bwO7Qqj0XVRBQrpoltepM9tNx2jrYqUqjOZ0MDih57y1a CEVkqjwCcTNKlcOYkkHaWcgue1KtHBAn8f8XIQO6CkTWzCwYMbKi9AbS+g+1DOyxs8qn dF15uT5V51jjutYSG/cXxY2A5Dj1d/xaMyEGuGb37lE6QlUOjLbYd2DVx/+ykXLS4KHm GoRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bATjamTQFYEHG82oC1A0rejRLdQ4TH54PyT78brdY/0=; b=zwFNdSsMaEuJTukafgH3yBYbEMlZh6UU3SReZVazZZEm8c17KTBKPdeJu9xEffu4EQ tXiVCWcNlo0wu9lTzTnqsqrzidDBlxO0AoTVBqX24ivv0bqF1hd9k4AFwnmSIFOF1lrG vObi8NUf9cZQ8cWnJfpwvqTUS8rDXaLigm05+/9RiPX2zDaZ08nssu6Zre9BUCY4VeiD gE1MVwhkOslKgweJKaMvX9RPv0ZgaskkzCWHpKpwWA8zXj0uFPJbDHgmZKLdM0jrumFy JvhjRuCRGgHeoKawFe2K5lRR6007/S6es9Io9C3oh8wB9xWcHpqZdTkjkzENJRWyud+5 Fy2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codesynthesis.com header.s=mail1 header.b=nIfTDFuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si9611129eje.325.2020.12.21.06.24.28; Mon, 21 Dec 2020 06:24:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codesynthesis.com header.s=mail1 header.b=nIfTDFuu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbgLUOXk (ORCPT + 99 others); Mon, 21 Dec 2020 09:23:40 -0500 Received: from codesynthesis.com ([188.40.148.39]:41524 "EHLO codesynthesis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgLUOXj (ORCPT ); Mon, 21 Dec 2020 09:23:39 -0500 Received: from brak.codesynthesis.com (unknown [102.68.73.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by codesynthesis.com (Postfix) with ESMTPSA id 6E9AB5EFBA; Mon, 21 Dec 2020 14:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codesynthesis.com; s=mail1; t=1608560577; bh=8PpVFaUjaHs2MJm3jQ7t5c/TtRcoscdZ1xfcf5mbWoI=; h=Date:From:To:Subject:Message-ID:MIME-Version:From; b=nIfTDFuuwtvrwlLI0gRUtYqIBv7ctWlG2OthJd0nkphVG5ftuWGLu1LfT9pzl+HAh 8cTAOpXQhKB7sr42uVeMzSARbE8P1058fG4fT1z9mXbov7nMthr3w70soD4rYq8igb 6SY50eMg/0PgiQNVi3WHVNxgZfiyKbyGyELZmAmyMc+CuDdUBdSO0x0Mh5Dh0u7TmA FNkrVt7VmzyTMqcah+tz0Y7xP3iU3TI7BOl0QeCboqSE/O1O9jFM4ZHNw5j98bYzvi tCLfJ6pnTku4Ec2nqnY/Ruawp8U/CB2fIJYLpU1whEzp1Xs2gFnoFZT6D+lhljoW19 qWVGgtIGhxJIQ== Received: by brak.codesynthesis.com (Postfix, from userid 1000) id 16D3E1A800C4; Mon, 21 Dec 2020 16:22:53 +0200 (SAST) Date: Mon, 21 Dec 2020 16:22:53 +0200 From: Boris Kolpackov To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Jonathan Corbet , Michal Marek , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kconfig: drop filename and line number prefix from warning/error-if macros Message-ID: References: <20201221094650.283511-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201221094650.283511-1-masahiroy@kernel.org> Organization: Code Synthesis User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Copying some of my comments from another reply.] Masahiro Yamada 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?