Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1117194rwd; Thu, 18 May 2023 08:09:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GzVfv0QyhvNdnCTr5c9wRBwE7Mj8J0IWklcvA/K0foJ3sWS9zzpGOvNw+q3qsVdRR5UoL X-Received: by 2002:a05:6a20:12c7:b0:101:7ccd:e197 with SMTP id v7-20020a056a2012c700b001017ccde197mr2878837pzg.52.1684422590196; Thu, 18 May 2023 08:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684422590; cv=none; d=google.com; s=arc-20160816; b=Xg9JSUdmPiIbUqKCNXC1dfnFm2Zqfg2PhjhwqfnIpr8vYSzcWWFIoo7jYJCLFu/P/a dTwBLfnT8+u68nffOEpIgC0UwjxiGnpQcxvK9IaYC9jLaPTGDGLphFZ2JzJErFWPgm3B toGsXw3SpaUe+LJddO4DAuYtfgwU4aXXMP2TDFqyFYJeRe9upTSeZlA+DpsrxiRMFOjP Tn6LkGR9xV6xYogl1U3WskXG3k1IIbBuMK+LJRT/LzwFioVC/kVOmWcVHKLQc1dBVKw7 PRNPm8vSpBQX4MM8YK4f68tKv2uz6Wdw883FSkIH0DfXc8oJdEmMykFPV8omUeXvl9q4 vMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1o59O+9Ej8aW4nujuOX3uB/Xm7vXtKmaNIi6I5lai48=; b=IlAV6xeEKnq88lyAJdsV3A9YKBa6lrJXbKH7jCqPNU3X3CmN6rfQbrxzucHGgzNCOg cHAzB0jN0uTcU+aTHWTAVrtpzXAgCf1FKfuwpDm3eGzZ8Pv3pBjbbkBtP63GlRcRFNKl /U9/Vl79YJxo0XnDgewWBkxmyQVeGz1AgZibtky7ixp2nYHxDhCps+WO7KchNJNjF/1t HLpHtIrulHMfhbmM7wU8cYbtER59f/qFAW22TnYPVL+1rWXMuAFqaxVb8IdBOR9X9Ijs +JfsEyaUk2698DWfF6Umd80LacnijEXN3Ipaxqxja7jaIN4DNetbbTRFVI/zXof9kxIj 5g9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNS+TekK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a17090a294700b00250331e6044si1842785pjf.25.2023.05.18.08.09.37; Thu, 18 May 2023 08:09:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bNS+TekK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231771AbjEROzd (ORCPT + 99 others); Thu, 18 May 2023 10:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231658AbjEROz0 (ORCPT ); Thu, 18 May 2023 10:55:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F3E12E for ; Thu, 18 May 2023 07:55:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0259764FD9 for ; Thu, 18 May 2023 14:55:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633CFC4339B; Thu, 18 May 2023 14:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684421723; bh=Ks2BcB2HxSbBY7mPbJIjN33LPo2/4OOsJWgK+op14zY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bNS+TekKDdkvsHrj3RcZ9hgMDDRdzgoHGGrErRzo9MA2Zow+POuD6WovfiWP2Jgsp PQUbyODWIX8J72tFeD7CV80O0qTjvIPGu2Gzz8mQ9EUiWTt/DaM86rHWlcaEzhzC2G GnjfrAlJl6ebtRnFELp9cPQdUPCmI2H82de93QX4C38jLPyGuOgO7wFMbg3V+C2tOZ 37Vof3pSyINO9knyDddsfeZ41kWd6UbNJ0+xCY0CYme0lBQr4BPlMSJmLZWR1HVwX2 LeTPM5goZ+1HPI5+rLZXOS3ouLPB3F4j3N6DHbcAz7Bzt3WQ04rdPIhkRS+32U0REI YH5IRbqHugzmA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 159FBCE04B0; Thu, 18 May 2023 07:55:23 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , "Paul E . McKenney" Subject: [PATCH v2 nolibc 02/15] tools/nolibc: tests: fix build on non-c99 compliant compilers Date: Thu, 18 May 2023 07:55:08 -0700 Message-Id: <20230518145521.3806117-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <4817a4dc-69e6-4937-84d5-f2f630ff646c@paulmck-laptop> References: <4817a4dc-69e6-4937-84d5-f2f630ff646c@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willy Tarreau Commit 9735716830f2 ("tools/nolibc: tests: add test for -fstack-protector") brought a declaration inside the initialization statement of a for loop, which breaks the build on compilers that do not default to c99 compatibility, making it more difficult to validate that the lib still builds on such compilers. The fix is trivial, so let's move the declaration to the variables block of the function instead. No backport is needed. Cc: Thomas Weißschuh Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney --- tools/testing/selftests/nolibc/nolibc-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 47013b78972e..6f2f109569a3 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -671,8 +671,9 @@ static int smash_stack(void) { char buf[100]; volatile char *ptr = buf; + size_t i; - for (size_t i = 0; i < 200; i++) + for (i = 0; i < 200; i++) ptr[i] = 'P'; return 1; -- 2.40.1