Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5134044imu; Tue, 8 Jan 2019 12:07:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN56YuMireOHyC6Xw/T2z2Awpxh6URu7d+/XQVNBTCgfLyks82bt9anoj/rnab9IcSB1myCm X-Received: by 2002:a62:f907:: with SMTP id o7mr3046029pfh.244.1546978067564; Tue, 08 Jan 2019 12:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546978067; cv=none; d=google.com; s=arc-20160816; b=E/0BaiMwUGZTFKaJ52+yAFEzctTK4sRG2llE9MLPs4juaQd169NIZkK86S1qWQ6Lv6 fcEKbo+nPovGw3hA2aipyKKls5cUt8scoxp9JkRMOEAWpXPsTif4O1i7dWKBKcX3Z6LZ 9UtTPalwlIMeQfaX/ydZHS0OqLQ8c8izSunbVO0uMpxCqxIW3EJ4tnMpxuse5GJ0KpLR BK6SwClsm05ajBur5KExrMp4Ljt/je0+SZ3XD62NlspDDd3t+0JeWypeiREIr7htp+kD KKWU3mGD3SnBxCrL3r3vwf5o+T0IhqtK7o29Tvp1IdibM2CUH8rd00iH2RcoMiWnKd8Q xOzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7hukziqctpKGD01qfZgkLNNTc2aN7dOwJ+cKw//Tm7Q=; b=fOo9M37HlfnpEAMsx9HgptKIdvSGBrdga/lZPyC835ea80EP3ssEc5EMaQwHNC+2tA aamt0d7Ku/9AFP7otOyoD1P4fKLewGTEHi+IsIscUGm8u6WieqA+J5f0eAqZ3HJvFaC8 QA1edXwXI5HlTfQNZ65pOsCUQoTgv6atMnJ7/Wz+nZAJZdzvleAqy6xdP/orWzkn2V/r AzyV4aM9ZhtDmh63eMGsv9MmEO+YY/jZCoPiph9jSF76i3z1CxOGVhoolEU84uDK/0H9 BB//TBqqLpSYwe96j3GwhzL4CebTzvxpbCwh+PGDG2AUCoNxD+2PfJYbcOzVtILdF4Jz RFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZPYffrRq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 87si10697153pfs.7.2019.01.08.12.07.31; Tue, 08 Jan 2019 12:07:47 -0800 (PST) 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=@kernel.org header.s=default header.b=ZPYffrRq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730270AbfAHUEt (ORCPT + 99 others); Tue, 8 Jan 2019 15:04:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:35500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730033AbfAHT21 (ORCPT ); Tue, 8 Jan 2019 14:28:27 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 88ED520645; Tue, 8 Jan 2019 19:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546975706; bh=qA+ZXobmVcIpgJuu+++TyxAlXb/AT9HGi40aXvqG8G0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZPYffrRqkMMjh4BYVxCvj0suUgY5cYjoDi723AyqoqKtNRyDWcVUstUuB658fzuZl KXaMCB8fuXOu09yd6NRK/I/oF0oWA0VRBi2UriBW25hRUeXb+IjtmWI1EXDdhrEXmU YIGwlDFKi0tymrd3pTScXFlSNdl740o1+qgSQKpw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Masahiro Yamada , Sasha Levin , linux-kbuild@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 067/117] kconfig: fix file name and line number of warn_ignored_character() Date: Tue, 8 Jan 2019 14:25:35 -0500 Message-Id: <20190108192628.121270-67-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190108192628.121270-1-sashal@kernel.org> References: <20190108192628.121270-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 77c1c0fa8b1477c5799bdad65026ea5ff676da44 ] Currently, warn_ignore_character() displays invalid file name and line number. The lexer should use current_file->name and yylineno, while the parser should use zconf_curname() and zconf_lineno(). This difference comes from that the lexer is always going ahead of the parser. The parser needs to look ahead one token to make a shift/reduce decision, so the lexer is requested to scan more text from the input file. This commit fixes the warning message from warn_ignored_character(). [Test Code] ----(Kconfig begin)---- / -----(Kconfig end)----- [Output] Before the fix: :0:warning: ignoring unsupported character '/' After the fix: Kconfig:1:warning: ignoring unsupported character '/' Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- scripts/kconfig/zconf.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 25bd2b89fe3f..eeac64ccc730 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -73,7 +73,7 @@ static void warn_ignored_character(char chr) { fprintf(stderr, "%s:%d:warning: ignoring unsupported character '%c'\n", - zconf_curname(), zconf_lineno(), chr); + current_file->name, yylineno, chr); } %} -- 2.19.1