Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3153961rwl; Sun, 2 Apr 2023 01:18:01 -0700 (PDT) X-Google-Smtp-Source: AKy350Z4RhcPtgg+6WOF6qwohM8NiVtyagRQA4j8+kEzUoasqlLLUuLeBMxVOXUUWXxdLdQoev4e X-Received: by 2002:a17:906:a117:b0:939:fb22:c4c7 with SMTP id t23-20020a170906a11700b00939fb22c4c7mr35238562ejy.43.1680423481131; Sun, 02 Apr 2023 01:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680423481; cv=none; d=google.com; s=arc-20160816; b=NnKwC24zQe8UyLPV4f+TjJrPb7tDWfaeaqMWL5gwpWoiI9gNzFTMIaLUJMM7WgK9ID Coq2EPlHar0Tn2E8Ye6DYjZipefo9OeRTXylJ9XKWdpcOXXaAWAf5vzCZTditMgrfpIM OPTSwFkfIbOJ6Ws4y+QZiuEKNdZI0QNo4Wqo+BCohxHJAJ+WWQqn5RMdrtshLdp+5L7X SvJ5fOvOrpBI9IoUTVFynjB0FR9W2au9w7okPHmHg8JAx/GMlXO+fwcc24we8+t9VsAH TT2UdaKxRFAVyi8y2JP6DOFMOdMRzBvO8gZhhk5DNkS+TRAdkzi4uhweF2xqyd0Zi74A 3BFA== 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; bh=1cMgdegfv3SytSCVrjDmaz9Y+SaRe47CyCXL6PQjt1I=; b=KmYNS4sCVcLIGYVcj1j40epooGS38fRJQ0kkhjNFw0c1y08csfZc8SXFgEM24ecdWA izzV9S9NIn2wvxnFX6zgQPZgsBz6nItGoCQrE58oek5DkQqROQA2ku7qQFGbqYGMpKFJ dNU7oLO1wUs7caaCAQ1UsqzwZmS+NxNJeWebUvb82G1JjiZ5n6ysS6DOz45o0Zg8E8DN bbJiKAXIyAdr3ioxISxHp5LP067BiAsVxh2hKs0j1q09Dc6BnQCAsDIS1mkw5rcw50b8 k+Y34OWKAFkiYNsj54Y6pjht+ZMJQ4HBZjMyatk4EzEnUSrJLmw4qHyhx5LkObbhiFpq P+Lg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a1709063a9100b00947ef6081acsi3484361ejd.843.2023.04.02.01.17.36; Sun, 02 Apr 2023 01:18:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230241AbjDBIOO (ORCPT + 99 others); Sun, 2 Apr 2023 04:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjDBIOL (ORCPT ); Sun, 2 Apr 2023 04:14:11 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19E421A443 for ; Sun, 2 Apr 2023 01:14:09 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 3328E30a012123; Sun, 2 Apr 2023 10:14:03 +0200 From: Willy Tarreau To: "Paul E. McKenney" Cc: linux@weissschuh.net, v@vda.io, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 1/2] tools/nolibc: tests: fix build on non-c99 compliant compilers Date: Sun, 2 Apr 2023 10:13:56 +0200 Message-Id: <20230402081357.12078-2-w@1wt.eu> X-Mailer: git-send-email 2.17.5 In-Reply-To: <20230402081357.12078-1-w@1wt.eu> References: <20230402081357.12078-1-w@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 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 --- 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.17.5