Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1174456lqe; Mon, 8 Apr 2024 00:18:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8otLSwp+GA1AEWQH4RUc3D8LxZb6sYJcj1E/uQFHudZdqhTOK+L5aQH7b55pybUqsdI/3I/2I1UVfHoWyjjyjPWVRtAjO/DcYlxny7g== X-Google-Smtp-Source: AGHT+IGY5DZ/SZIjU9y0qFQLeCUpZbC3umQGq8wrOzFLpfHuzSj4W+9Z+RZIDUpLZ6MzL3zu7e+H X-Received: by 2002:a17:906:c34b:b0:a51:d605:49e6 with SMTP id ci11-20020a170906c34b00b00a51d60549e6mr922950ejb.10.1712560690851; Mon, 08 Apr 2024 00:18:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712560690; cv=pass; d=google.com; s=arc-20160816; b=tO1ukPA5DpWYYT/6bxQC2BgIW+PBKFBXC+tUzQqq7QHRL2PRFghJa5iS+fW4a6+a0V t3tv66G6mBMyJMg8IjMVX+MNZjdchRHhcvivDOcYJHg7Sr9Ec2nQnnhaI5Mqgi2QAHyH 5gALu5+qL2lNcsxT1rZ7nRcSiCdDi5fgzdlqwrqPb8sla/XagdFwKuQwVAOZvP/cgi78 uMkdlQHd/DJssKXoSD0kmSxvob9dSXBYFX6zsmrahXqt7h+t1cMt2qVCNEXL4aN/0Cmu 5bWSmiTxaYBQYsTmv78Dhx9hiOhjGOhIo0ld4I0jMsrWsyT4b2RXrqDPgBk6/9IXCfef 5mxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qMj5vNxhS75Oud5P2OGCdKwCCrBhLyDxBwFKha1s+uE=; fh=x1a9EUg89h7LCwThJxxVty6+eg0iRSKW7wfcSOZ+MjQ=; b=KuqvKAKJn+JnHDSeSWiM4Bf6SIaKB1cCQ0q83PGsG5WyU0Wq5CUNg+ZnRyej0CNrO9 aZca3ubfBc9M5TSPhxiGVs0Qs7ours+eYgzG2Nc1zDBlx0mMb/bTKfqNbl8bUyI8t6c0 qpuHDurVAssnHfbVexgqbpM3ZwyCku1rHkfQ4uthiQZzZu7boj/hzm3+tIBouGcwdp7q uJ6k7T3cpkSMlaAo7tzTGw188AjPpJ5Wub0KqvbZ74IJTkNLqP/WDrkGZhIuglDPRYuw vwVdGOaFKOlsCbqwQQqWbe+VLvIRukMLkEN8dDamCMwtJ8bNLLtEnkVodJaBsaQ8k2sd hAvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UgLeGJ76; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134883-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134883-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id rn21-20020a170906d93500b00a519e255f44si3389726ejb.57.2024.04.08.00.18.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 00:18:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134883-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UgLeGJ76; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-134883-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134883-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 090571F2239D for ; Mon, 8 Apr 2024 07:18:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FB522375F; Mon, 8 Apr 2024 07:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UgLeGJ76" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36B701BC39; Mon, 8 Apr 2024 07:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712560684; cv=none; b=iPAvMEsJsHKG5LhvYBSdp/gh6MJsiYholl3dnb9T7NM4QMPoHwEzhJAyJlDtv3Alt9vXBK4yb790lK3gCxJOCpxaBr5bE9mmcBNs67iHgKB2p0d6T8QTS6f8sKiZfl4bC+iBHF2+cJCybCNAkct5rB+WXLmpUopIoutOfBrHK3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712560684; c=relaxed/simple; bh=PeBPt4G9W0LmsRTARU9M+5NwqUbIJJWVt9mpkDc2sWg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=QfrHXKIXgylZNnK2db6uppuBtrvn/mv0gxjgpqRP+eog1B8Lh6gsxuCce3fR+bM0GvES5AWrap9i9WUQtfnqjn0728NrXfaiTQX53eH+qwsZULVppONjtSJGEcbbstuLNUnXHw7QHZU+UYIHCSDIzQEnCP5feAYPP9oZNXo4NdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UgLeGJ76; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04AD8C433F1; Mon, 8 Apr 2024 07:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712560683; bh=PeBPt4G9W0LmsRTARU9M+5NwqUbIJJWVt9mpkDc2sWg=; h=From:To:Cc:Subject:Date:From; b=UgLeGJ76YP3rd6UiwswfVWrpKIHDyxNPQic39I/Spme7VRat0g+2xW/AiXlz6FdDf lsemZ3tLEXS0hqvpZoCQK0ZJlVjO+s9MbC8H0AQDn+UmraV7OexV1Yoflm49jOfAts cXdwrtgzDqihIwGO/Pt0id5EpsODa1ksBFoyDsABRARPsqapRINpGZ/DxxkrfTk2O0 3glL661XlJ+nQojgSMLcerJjV4kcDqmf3DHIvdiV7U3OWnCXp1mP46HkDEJWDEPEk+ Dp0aTe163K3z3TBa4ZKc01uLQAAyYeSXJstdcI7Hr+ViKyhGSbX9IVLnTnDuQJWmsv k87l5ACeSDbug== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org Cc: Arnd Bergmann , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Tony Finch , linux-kernel@vger.kernel.org Subject: [PATCH] [v2] scripts/unifdef: avoid constexpr keyword Date: Mon, 8 Apr 2024 09:17:52 +0200 Message-Id: <20240408071758.2526806-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Starting with c23, 'constexpr' is a keyword in C like in C++ and cannot be used as an identifier: scripts/unifdef.c:206:25: error: 'constexpr' can only be used in variable declarations 206 | static bool constexpr; /* constant #if expression */ | ^ scripts/unifdef.c:880:13: error: expected identifier or '(' 880 | constexpr = false; | ^ Rename this instance to allow changing to C23 at some point in the future. Cc: Masahiro Yamada Cc: Nathan Chancellor Cc: Nicolas Schier Cc: linux-kbuild@vger.kernel.org Reviewed-By: Tony Finch Signed-off-by: Arnd Bergmann --- v2: include fixup from Tony --- scripts/unifdef.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/unifdef.c b/scripts/unifdef.c index db00e3e30a59..ff15efd6e7d7 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c @@ -203,7 +203,7 @@ static int depth; /* current #if nesting */ static int delcount; /* count of deleted lines */ static unsigned blankcount; /* count of blank lines */ static unsigned blankmax; /* maximum recent blankcount */ -static bool constexpr; /* constant #if expression */ +static bool constexpression; /* constant #if expression */ static bool zerosyms = true; /* to format symdepth output */ static bool firstsym; /* ditto */ @@ -819,7 +819,7 @@ static const struct ops { /* * Function for evaluating the innermost parts of expressions, * viz. !expr (expr) number defined(symbol) symbol - * We reset the constexpr flag in the last two cases. + * We reset the constexpression flag in the last two cases. */ static Linetype eval_unary(const struct ops *ops, int *valp, const char **cpp) @@ -877,7 +877,7 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp) cp = skipcomment(cp); if (defparen && *cp++ != ')') return (LT_ERROR); - constexpr = false; + constexpression = false; } else if (!endsym(*cp)) { debug("eval%d symbol", ops - eval_ops); sym = findsym(cp); @@ -895,7 +895,7 @@ eval_unary(const struct ops *ops, int *valp, const char **cpp) lt = *valp ? LT_TRUE : LT_FALSE; cp = skipargs(cp); } - constexpr = false; + constexpression = false; } else { debug("eval%d bad expr", ops - eval_ops); return (LT_ERROR); @@ -955,10 +955,10 @@ ifeval(const char **cpp) int val = 0; debug("eval %s", *cpp); - constexpr = killconsts ? false : true; + constexpression = killconsts ? false : true; ret = eval_table(eval_ops, &val, cpp); debug("eval = %d", val); - return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); + return (constexpression ? LT_IF : ret == LT_ERROR ? LT_IF : ret); } /* -- 2.39.2