From patchwork Sun Apr 2 08:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Willy Tarreau X-Patchwork-Id: 78193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1630944vqo; Sun, 2 Apr 2023 01:23:55 -0700 (PDT) X-Google-Smtp-Source: AKy350aBUjCan4T7vdqhWmRZ2zEz8SoMztmiu2GPOG3c7z39anu7LP+XPjdWavFjGB2+kvtUt4zE X-Received: by 2002:a17:90b:1d86:b0:23b:3f18:a8fe with SMTP id pf6-20020a17090b1d8600b0023b3f18a8femr38044088pjb.31.1680423835182; Sun, 02 Apr 2023 01:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680423835; cv=none; d=google.com; s=arc-20160816; b=0YU4kCTJYyQH7GWYilvTZuRRVJxZHggJQm9QlX1PdxNgjDNYWUyiiglBPXgmErIJ5R Q4BFuz44VKb4ViP74LAfVF7l9vE1BQMl7V7QSa/geb4lafP5QU2pRPAw66SOIyEt1MXb RrYCiNViigVGeJUkJmpm4M5F9rv989HHmHCp00kBXinxYMHHidG30j5d4U7K0PfBa/uk I/tKkGw6WGYgnIQy2AzyTzU5hJwIi1rTG1vVvDCspAEATb57al01Ti+tFATcgyxDCjwl 3VF65LH4RD2u9smEv4/REqbRCSQcmTTJ7R7cHFX9Uu1ULqMB7ClsevK5PqxK0AxcyuUW bzNw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a17090a9bc400b00230cb79e2b3si10508199pjw.104.2023.04.02.01.23.43; Sun, 02 Apr 2023 01:23:55 -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 S230242AbjDBIOP (ORCPT + 99 others); Sun, 2 Apr 2023 04:14:15 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762052103422236458?= X-GMAIL-MSGID: =?utf-8?q?1762052103422236458?= 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;