Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5466121rdb; Sat, 16 Sep 2023 20:03:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGay40nD201dcqT+AYVLqlSxUnxfWcrhvR5lY0jTctuGDK0p+G0AgTqO5mErgCIZNxP+OTt X-Received: by 2002:a05:6a00:21cf:b0:68a:5395:7aa5 with SMTP id t15-20020a056a0021cf00b0068a53957aa5mr6576833pfj.17.1694919809706; Sat, 16 Sep 2023 20:03:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694919809; cv=none; d=google.com; s=arc-20160816; b=AQ1cherJZ49s1bfndXNKzCU5zt0gaBXfIod62wnHM58hh/4+uztHOFcAbRdBYLKU9Q XOiJPbo91le24XtYqc6jqWPttf/ajPRGmmFEXzDF5pbuw2Rp39p/muYjshLI6xGf68e9 iSG2tuouAQkCvFh597M2uoVUrVHd7dydbD+IsHCKVWhNRNy0rxmHiEWkK9bTpUXNeHbz b5XCGQjl3HHJYJx/5PejdKu0jv6k/urg3p7pH9vM4iaFFkXQBshc7nmsgdlAm/RoLuft vm2OCNNbteAhWml3nUIaeYW9attMZZKOxWIkh8+mFpZdALvBBZdO3sQ35mWTTrdeWEBy ExTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GiXzhgVAua6icuqdBvxix3wGXXUYwNCN6CkCkYiU0ro=; fh=q3eJ70+nPBBOurH5DI6uivZtkSdfT1YhlPrRDAlF5bE=; b=oM9Xl8oMPzVDWy9YTdgL2guVeTcaC72zi00weKqfNpzVND3bkNhlNg3D9PSMn+MUQF CKSW8cgxuTKBY0V75e0RxM/C/iqihHvv5ooCiTg2r1PhN60Wegczm5Yi7N8laO/duRcv RbEsXmLsqxn91QpJHUwgHUJi/CAGHmToZ5QGPaG6miSQWGN7Hi1uC2VEEiGpuKXHBkGt nILk8rZ6OvfWQE0wnZnv8TpfKlgdtxZSHh1hLIynHTvrMzWBnb+OEy24a4+gEFU+DCtg bWh58XBDNHKcyG+aPhay5ZeC6fTXXKDUOc900WiagqGLpCvepV4P3128Dk/lojjTTzTn RKkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bt10-20020a056a00438a00b0068e4358d041si5778916pfb.175.2023.09.16.20.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 20:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EB095832FDD3; Sat, 16 Sep 2023 19:59:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbjIQC7S (ORCPT + 99 others); Sat, 16 Sep 2023 22:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjIQC7N (ORCPT ); Sat, 16 Sep 2023 22:59:13 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50BC31B9; Sat, 16 Sep 2023 19:59:06 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 38H2wpBv009880; Sun, 17 Sep 2023 04:58:51 +0200 Date: Sun, 17 Sep 2023 04:58:51 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks Message-ID: <20230917025851.GE9646@1wt.eu> References: <20230914-nolibc-syscall-nr-v1-0-e50df410da11@weissschuh.net> <20230914-nolibc-syscall-nr-v1-2-e50df410da11@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230914-nolibc-syscall-nr-v1-2-e50df410da11@weissschuh.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 16 Sep 2023 19:59:53 -0700 (PDT) On Thu, Sep 14, 2023 at 06:01:18PM +0200, Thomas Wei?schuh wrote: > The ENOSYS fallback code does not use its functions parameters. > This can lead to compiler warnings about unused parameters. > > Explicitly avoid these warnings. Just out of curiosity, did you find a valid case for enabling this warning or were you trying various combinations ? I'm asking because I've never seen it enabled anywhere given that it's probably the most useless and unusable warning: as soon as you're dealing with function pointers, you start to have multiple functions with a similar prototype, some of which just don't need certain arguments, and the only way to shut the warning is to significantly uglify the code. If really needed, I'm wondering if instead we shouldn't have an "no_syscall*" set of macros, that would have the same signature as my_syscall* to just consume all args in the same order and return -ENOSYS. E.g, consider the following: @@ -934,6 +960,11 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva #endif return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout); #else + (void)nfds; + (void)rfds; + (void)wfds; + (void)efds; + (void)timeout; return -ENOSYS; #endif It would become: @@ -934,6 +960,11 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva #endif return my_syscall5(__NR__newselect, nfds, rfds, wfds, efds, timeout); #else + return no_syscall5(nfds, rfds, wfds, efds, timeout); - return -ENOSYS; #endif What do you think ? Thanks! Willy