Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp305205rwd; Mon, 12 Jun 2023 13:56:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54hM1KWSbS8iQ1ldGO6iTSxFXUhQH+YIIqI1xhS9qVclQBQL+19bUoIXBv8AETqdpUNJOj X-Received: by 2002:a17:907:745:b0:978:adad:fe18 with SMTP id xc5-20020a170907074500b00978adadfe18mr10862213ejb.21.1686603386610; Mon, 12 Jun 2023 13:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686603386; cv=none; d=google.com; s=arc-20160816; b=GICOM7HkSGwUKQ3BVR13SJDAFwrOldC11DseVLJNbQowswZ7QBG+InMhqczERs2vXQ aDr6x90UK9yJG9o5GUTxMQufA0NZFsrDTQu9OirGVq+VrxGc5KtowfqOhug4H46aSRPC bsf/0pIAvmBygav7yB/MTgLJn6DVydmmWs0wvF5XofufTV/dnyKgUUcxLV+b+nAgM+ld AZtZyHRZ9Q0uGqDlbH9vI4gBwBHqIqOoqDsQQTlb0lTPutd0m4VyNMffeXKKF30DS+J0 RHhvguUeFZavA6rUXkqQE6ljDK5ck2lJw75Kj+2VZ4p/P5W7r3AhLV5ZAUUzrE2y6ndR Cvpg== 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=Dl7vKI02Ge8mpz/2RWCFRh+nsbGXx9Qn4U3KoNG4nW7z4d1ss1XZ0jdpLW77e2Fefb K/7Bi1JRmXY2FRo/XhbDL34QkjI8x0oeU4bWIh5n1chsP5sHuGHYzEE/Jk0QDgJEwgFT Dor39a7Q25ZyGezGHPIAeUS3F5xL3WyKUCm9byDuU488788TiX19AS/aTSP59clQOLc/ 2OS2jpe7fhdeH/B9MGYC0SkWdCwyijocqV7W/ZljuDfQr34NTsAPK+oFxtkJOMA2Iijd kIobp4NyhDW+APAyFsem60ni95XcBFHFAkDAe4jSjUBeoQiuJR3AEMJu7xkcjrBG4T/w QcKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qKsK0qas; 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 b22-20020a1709062b5600b0096f8aebe45asi5268848ejg.278.2023.06.12.13.56.00; Mon, 12 Jun 2023 13:56:26 -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=qKsK0qas; 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 S237301AbjFLUr3 (ORCPT + 99 others); Mon, 12 Jun 2023 16:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233679AbjFLUqx (ORCPT ); Mon, 12 Jun 2023 16:46:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6809A211C for ; Mon, 12 Jun 2023 13:46: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 ABCF0628F5 for ; Mon, 12 Jun 2023 20:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 143D4C4339B; Mon, 12 Jun 2023 20:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686602716; bh=Ks2BcB2HxSbBY7mPbJIjN33LPo2/4OOsJWgK+op14zY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qKsK0qaswOjIPy/bfoiU2TOM1/2acMdTaVJYOdvnom0Yvol6riU4QsLoeVugqdzJd ytjj4vt8Zs/NSkQUQZ0cqq8s2ugQCzt0I02kbarHRczMelvrtC5C00E1Dh+S4sadFj loHr247JnuzICjBnjykJCDoYd/c1P0uUeA/BiuDfVufh1s1YbKL/nqCeU3sldQXakf HjpT3AJDXX44dDApGiDiSW7oQZUFZG+JoT1NTJROAmgJWAHftzC6+BUk60qN065crr yUacKFoSUeA5PETCpDvGWv98FFZXWYTzSNXeCgedrfEabEngh29Gbit/FY/OQsN4l8 61Kx7OOKqbAww== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id ACF14CE0563; Mon, 12 Jun 2023 13:45:15 -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/53] tools/nolibc: tests: fix build on non-c99 compliant compilers Date: Mon, 12 Jun 2023 13:44:23 -0700 Message-Id: <20230612204514.292087-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> References: <8b757cc0-3719-4e63-a755-9710384137bc@paulmck-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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