Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2474487lqb; Tue, 28 May 2024 00:22:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVwA4BjZ3dLYOTqFjFf3mtHeO7be9FI6Egwbg3BtRVuoiI710u/ho3ny/H3NGmy89P86ohn7wUvcspl/9nY1OhhN4VlJYFbFevU6watJA== X-Google-Smtp-Source: AGHT+IH3RXcu1J9gWC1dpi67u5uC6V+J1Nqfjk/7q6yGBaxdwhzNyv42kL36RuVATxImybbw4fiO X-Received: by 2002:a05:620a:2097:b0:794:d3e9:e83d with SMTP id af79cd13be357-794d3ea5c51mr58582485a.10.1716880941232; Tue, 28 May 2024 00:22:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716880941; cv=pass; d=google.com; s=arc-20160816; b=HI1R8lKoSnjI6R9/g729Q/4sgQmneSt0ZquSz7lEy8KoobobbyhxSqBlYUVUckvQHQ tAxrys/a3B3CdtYCsjLumREix/ZJAINjpD7Kq03k+8mQ3SuGGMyk0DV5RQjRM90g3mfV MfJP6Gf7dTqD8/3V8fRafAapsZdj5mBLdMmmu1fgkhngXUikxf9w02QNE8tW/UUu3ljF wCunRw2cf9fBnmC2Yv2bfii5eBPmv249ZHMbeZeS8XULB4PbFlgnx3yxV1LoftR5M6Tm 7iXsLXdjqJbxU24YxlsN+f8xXi6Wj2xteMTgLmW8tmY9QnVficIOPUotLNWkcjbj6DZ1 AhTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=3hoxrDK/6TJL189QfPAFPqqJOrRkhWbibZDX6COGJrI=; fh=S/47B6llb+CSbGugqrwzEXKqtGBlASbnxTa34yTrrNE=; b=Kn7D0Vi10mewlI87da2o/opKp65zUJ1NFoOqMIrUuO55c9YLureJiypLjwJRZBH+1R OY6nDWgtpN3NTTGWo6p1m2ikWxhEAqM00VW904k5CRrQInZjtuwzypoM4ON10a9ag4GK RN1UQP29087+S/we+0XNs8AVQwOFyuSI9NNrNAlKZ2HkboAb/GA5kqqdrLAklcMccc3X GZ5WyLtIwU2GVGGUF9gbUkWvmheOoJwwAvTn1B/Pq70Zh1PrdMCaB/dvr4FpbxrTsJjr E0V3dfmiSNu1kAJnWK0V1oD47gB8klhsk1gP9SF0NxGicyHorHaq0QUz0JvAqj/tOd21 0nLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alyssa.is header.s=fm3 header.b=GbNgOD7+; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=GxrPz8mC; arc=pass (i=1 spf=pass spfdomain=alyssa.is dkim=pass dkdomain=alyssa.is dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-ext4+bounces-2663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2663-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abd51103si935997985a.581.2024.05.28.00.22.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 00:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-2663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alyssa.is header.s=fm3 header.b=GbNgOD7+; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=GxrPz8mC; arc=pass (i=1 spf=pass spfdomain=alyssa.is dkim=pass dkdomain=alyssa.is dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-ext4+bounces-2663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-2663-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B158D1C21C18 for ; Tue, 28 May 2024 07:22:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 982197317C; Tue, 28 May 2024 07:22:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alyssa.is header.i=@alyssa.is header.b="GbNgOD7+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="GxrPz8mC" X-Original-To: linux-ext4@vger.kernel.org Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4F134F201 for ; Tue, 28 May 2024 07:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716880929; cv=none; b=Rr3x6t1NuQ5Qie7nA3XPa4sMJujVfMCtxee/OFH9bSKz9ph/4twnSt8ZUCQ9rTZenXqS6F2iGCyij2YzQdMhYSprjCpIzMzzD8YMXleDDdLU6495A8KbIzSKGbPKltuMC6qwxFBxXl394ea/U0T9de++nEkMRTPGY10pp+ORjJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716880929; c=relaxed/simple; bh=6POq/yNF2NeHKtqqteLx+vxQ0MJRnno63kaLBUzwNvo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=mKQ7Ur+aR1b8pDfg5SmbAwWyCVqkdLb+Ao8q+B0/FSuMof8nJODxaA7kezMjvgkVKQkCmqlfTZ9/Z6aRsSiRFux6CQwaPLaLcEwFj4mGfncQfEJgDWxnXjXCFl7fVt0X/U6GUflHzTdfEo+G4vlaN26foXQj3wqGpEf1lnQBcRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alyssa.is; spf=pass smtp.mailfrom=alyssa.is; dkim=pass (2048-bit key) header.d=alyssa.is header.i=@alyssa.is header.b=GbNgOD7+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=GxrPz8mC; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alyssa.is Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alyssa.is Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id D84F711400CD; Tue, 28 May 2024 03:22:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 28 May 2024 03:22:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1716880925; x=1716967325; bh=3hoxrDK/6T JL189QfPAFPqqJOrRkhWbibZDX6COGJrI=; b=GbNgOD7+v2LpS+/McCfXo/E4YY +A8UyjBCgf2VVJngK6XBEf/qfipqwZb4zOv0fBfaWMBSZ8Ig617rL4PBJL+Mjyuv mqdUiLdU3fEvK3Aos4fbvukYVqvjgIwTGywt0BPsAZ49MZahZA2A+NtyCFrVwpn5 wnrsVZf8Nzkyq4D07OLStfNwLzvwUQKZmuINGK2YsVhDVWr/9rb8+HEaTebl911W qHY1PbsHOmgaiXlULgsHiVXnnzwpVWnoq1a+qBrx+sePboZ25iaLqBB5JgZruGx+ mCurgkD+sj5Pdb2LVrlfe89kepVsSFXyqwlYFNP3qAV54aMp1fl50OZBk6zA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716880925; x=1716967325; bh=3hoxrDK/6TJL189QfPAFPqqJOrRk hWbibZDX6COGJrI=; b=GxrPz8mCOI1aCGyO68xw3nlNd0f3HQ2Jdxqj1dwvJ+RY 1DqfLL/2lF7/Vv0Y+HbntlehdvHfNeVNeb+0JtnSiolKbpG+A790m5RLGbWD8vBD KDcqbxT0tax5V6Q9bALKcO3emeky+fh/LwmgBM5IysyB8jwioE/afkazo1ZpWqaV KqbCPx8oFP8pTqMYmEtSoa4d2/IKYP3pmVqTBIdgO8oKJoHh2ZM7vIFU+f6ui0nE X5Jd+bfoqNd9zTaVV3+7EuMq50WdanNj0/rNjrveSK9O7Udl3zQbC/qRCI3Jrq+P Ehr/whiiNqwqmWdkp2O2Y3oTPVSanHu/HeKQDwYdKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejhedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefujghffffkgggtsehgtd erredttdejnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdr ihhsqeenucggtffrrghtthgvrhhnpedugefgvdfgudekveduvdekudehffejlefgueegie duteeggfdttefgtdethfdvfeenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhmrghk vghfihhlvgdrrghmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 May 2024 03:22:05 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 0842451A; Tue, 28 May 2024 09:22:02 +0200 (CEST) From: Alyssa Ross To: Theodore Ts'o Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH] libext2fs: fix unused parameter warnings/errors In-Reply-To: <20240528064958.GB1294551@mit.edu> References: <20240527091542.4121237-2-hi@alyssa.is> <20240528064958.GB1294551@mit.edu> Date: Tue, 28 May 2024 09:21:58 +0200 Message-ID: <874jaih04p.fsf@alyssa.is> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Theodore Ts'o" writes: > On Mon, May 27, 2024 at 11:15:43AM +0200, Alyssa Ross wrote: >> This fixes building dependent packages that use -Werror. >>=20 >> Signed-off-by: Alyssa Ross >> --- >> I'm assuming here that it is actually intentional that these variables=20 >> are unused! I don't understand the code enough to know for sure =E2=80= =94=20 >> I'm just trying to fix some build regressions after updating e2fsprogs. = :) > > Well, note that you only get the warning at all if you use > -Wunused-parameter, "-Wunused -Wextra", or "-Wall -Wextra". The > unused-parameter warning is not enabled unless you **really** go out > of your way to enable it, because it has so many false positives. The > gcc maintainers do not enable this insanity even with -Wall, so > someone really went out of their way to make your life miserable. :-) Yeah=E2=80=A6 https://github.com/storaged-project/libblockdev/blob/7cd19d14e61c8964187eac= 99cf276e6c999dc93e/src/plugins/fs/Makefile.am#L5 (In this case it /did/ end up with me having to look at the code and notice the SIZEOF_SIZE_T bug I sent another patch for, so something useful did actually come out of it this time=E2=80=A6) > I generally think it's a really bad idea to turn on warnings as if > they are overdone Christmas tree lights. However, to accomodate this, > the normal way to suppress this is via __attribute__(unused). To do > this in a portable way to avoid breaking compilers which don't > understand said attribute: > > /* this is usually predfined in some header file like compiler.h */ > #ifdef __GNUC__ > #define EXT2FS_ATTR(x) __attribute__(x) > #else > #define EXT2FS_ATTR(x) > #endif > > ... > _INLINE_ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) = old_size, > unsigned long size, void *ptr) > ... Okay, I'll send a v2 using this approach. > You can also play this game if you really have a huge number of stupid > gcc warnings that you want to suppress: > > /* this is usually predfined in some header file like compiler.h */ > #ifndef __GNUC_PREREQ > #if defined(__GNUC__) && defined(__GNUC_MINOR__) > #define __GNUC_PREREQ(maj, min) \ > ((__GNUC__ << 16) + __GNUC_MINOR__ >=3D ((maj) << 16) + (min)) > #else > #define __GNUC_PREREQ(maj, min) 0 > #endif > #endif > > #if __GNUC_PREREQ (4, 6) > #pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wunused-function" > #pragma GCC diagnostic ignored "-Wunused-parameter" > #endif > > ... > > #if __GNUC_PREREQ (4, 6) > #pragma GCC diagnostic pop > #endif > > I do this when I'm defining a lot of inline functions in a header > file, and some stupid person thinks that -Wunused -Wextra is actually > a good idea (hint: it's not), and I just want to shut up the > completely unnecessary warnings. > > Cheers, > > - Ted --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmZVhhYACgkQ+dvtSFmy ccCNvw//TnqxpUrZ5+5aRgqiVF39u1Snan3ksN/+3zm/CRPHtj0x8TCf2rlSyKwd CMnGAMD/oroGUpo99+e1YNyOR39Iu7l1UIY1M1uzOIN6aSrKCpdo6O13XIwOq1PC eKCJ4M+fT3XKFjtR62t1oqYblpcRQAFoLNHLITP1v3Vl7fSfDqBd99/F5lPLuuXW 3Ii8RBnA4O4Fgpfu+x1SMpQNHwXKR3r4kh8JDfkONmobKLyqLR4KC1yDQKyLIt2k ANnC+kpgT1pNHYAGcxmo4p/KDHHmxx6kWZX2Y5dWI+IDxVOvKuBS0eyDoPiy6pig qfZyuPn2UZxSB6cZt3OrnTkdwrjG7PaxllGDdaROj5PnpftKtnyHTFvbRi7dBmKa UANTI65YCdQFRjP8WWpl+4n45Acjc9KEPrE8QF4WckmxVpvQAb89SJZAxgjt1XnC gxslwPcMWtw23oTuatFJOYTm5zOf1Fwt5fzq5CQTRot7wNg49G6aYru1KjrSCYIJ IPCQwq39/y5xik6lQphTBWnlDpo1/jiERRYXi/JrirKF0gENiXM2a0KV0vdyp1xy 4WV9kyEOwCcpV5g2PQqplfjLuOlW0P0NUwupXC0p+k+w0eJx+z15n5d4TMeiamDR s3S/VQ1IDNo7LcyAI34woWesOdFQy8WI54LrfI3DpRj9INpsEgs= =r9sh -----END PGP SIGNATURE----- --=-=-=--