Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5378420rwb; Tue, 1 Aug 2023 01:14:56 -0700 (PDT) X-Google-Smtp-Source: APBJJlEkAhsgZ7OjLuZhJvu9frPGcZUJTpd218cCaPRmlYEKInpjMSOpO23gj5LDlcKO4Mk6gO41 X-Received: by 2002:a17:906:7a4c:b0:991:caa8:fc3a with SMTP id i12-20020a1709067a4c00b00991caa8fc3amr1864492ejo.72.1690877696202; Tue, 01 Aug 2023 01:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690877696; cv=none; d=google.com; s=arc-20160816; b=vNbPfELhpbsLBlzr6nzT4OvGUV3V57yUvaVzVqNaOC0LfcSRV1dEX91JFJpI4EiCjn rrXr7eVjOUE/INYy6ln4x0svtqZqObUlcAepixHm6mFD0rB0SDvWs4cOf3QxeCVc0TIn 1kCGGZy8X/+4qqZcAQAb+9SJ7XntobufhzQdnQFHy3Roa/Hyp6vabE6Yn69Qu1suCYak G9/LAkHl1pfaH/Hk+uqHm5oiyYmkQaJN8+rMmrKPY9crvVE8MmCxqH4FPpM8DOmgMPE1 Fj9MAsgbka32LVGRfYsrQJEo78yAba8ThRyYlq0IMAkrzqZ307rkCT7lUFohbsp778Lq 12YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cb8AWuqgRhySlYU1YOxAzSmz5HxKM+nXG3FXac2/m2Y=; fh=TTF1lt49Sby0rKay1qRjEqWFbUkg3/0Ba8LROUDUaGE=; b=xzMDKoJ76vbjdoy3iFu/4XscS/oNLjXAh2cPqNkA/+KF09np+jfZ+LD9icKIiHeo7C GkagX2vBkcg01sBXSpS6EDUzSetwb8P17v8eOz+fnMYNkG1y1/jUlP7mxUqRb/drcw5Q 7H3spgx1AaiCe4FKTmj1PGunh4RbfOo8E8B037qgvfVVbW4NYjXKym3mhVGW6PbrIlly n0fqHh1o0gAIfYVW20P1pmDKnxY4Mv2S/n0U7ltVe8DPD9MKTKsPWFYHjvMgrUH9ahLC BDlAcmcGRbf3i+v7lzA4Tvx5/JE9WcA9PSjMmKgP54w2Q6IUJ4NqQW5mgeVJrn2sUq0j lXHg== 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 y9-20020a17090668c900b0098884f86e43si8508645ejr.1053.2023.08.01.01.14.31; Tue, 01 Aug 2023 01:14:56 -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 S232116AbjHAIH4 (ORCPT + 99 others); Tue, 1 Aug 2023 04:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbjHAIHy (ORCPT ); Tue, 1 Aug 2023 04:07:54 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB9D911D; Tue, 1 Aug 2023 01:07:51 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 37187ScL031011; Tue, 1 Aug 2023 10:07:28 +0200 Date: Tue, 1 Aug 2023 10:07:28 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan , Zhangjin Wu Subject: Re: [PATCH v2 07/10] selftests/nolibc: avoid unused arguments warnings Message-ID: References: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net> <20230801-nolibc-warnings-v2-7-1ba5ca57bd9b@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230801-nolibc-warnings-v2-7-1ba5ca57bd9b@weissschuh.net> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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 On Tue, Aug 01, 2023 at 07:30:14AM +0200, Thomas Wei?schuh wrote: > This warnings will be enabled later so avoid triggering it. > > Signed-off-by: Thomas Wei?schuh > --- > 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 53a3773c7790..cb17cccd0bc7 100644 > --- a/tools/testing/selftests/nolibc/nolibc-test.c > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > @@ -1089,7 +1089,8 @@ static int smash_stack(void) > return 1; > } > > -static int run_protection(int min, int max) > +static int run_protection(int __attribute__((unused)) min, > + int __attribute__((unused)) max) This one is used to silence -Wunused-parameter I guess. It's one of the rare warnings that I find totally useless in field, because it's simply against the principle of using function pointers with different functions having the same interface but different implementations. As your code evolves you end up with unused on absolutely *all* of the arguments of *all* such functions, which makes them a real pain to add and tends to encourage poor practices such as excessive code reuse just by laziness or boredom. BTW it's one of those that are already disabled in the kernel and we could very well do the same here. Willy