From nobody Wed Jul 20 22:19:23 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lp9993TKLz4X67F; Wed, 20 Jul 2022 22:19:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lp9992pr8z3j6Q; Wed, 20 Jul 2022 22:19:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658355565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RUoVOcGAxD9bdMPtFLrnz+rpi4bKXbBz48RGmiKTyh8=; b=CBXayZ3DDSf/kdrOz7k1CViUu3afr5dr2MRmWFEdjZtfvfIZroSjlbJ6pAhZNCGWD5EYgZ bFeqAs8ZYNG8YQMUNXW8ZfyuNJ3DGFMU3Vht5EgOP1QIqIeDb8zk0oHKsn2b0IjFhCV86C 2KqvcbuszM+Lzgauc50X/shcKPEb9zNqwoqtyP1GTUFMn5r6dpEN9zR94WygN7o/K8M/wq O6q6lTeyIbAJmQnd/pFKh7RtgTHwmCMKfp1k86GZNyRo8vPWxIT6F8Z0HMUIG4cNZZbBIQ cA9PGd7J6fs+DUuLjGSg7T+S7Wbv3eS+1A0Xi9WmneYPZzQAYaM9XDAZ0wSp5A== Received: from [IPV6:2601:648:8680:ed60:a92a:730f:681:b1f9] (unknown [IPv6:2601:648:8680:ed60:a92a:730f:681:b1f9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Lp9985cNYz1DTD; Wed, 20 Jul 2022 22:19:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Wed, 20 Jul 2022 15:19:23 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: git: 3dbe05f61b65 - main - Suppress unused variable warning in mfi.c Content-Language: en-US To: Dimitry Andric , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202207201650.26KGool5002853@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202207201650.26KGool5002853@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658355565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RUoVOcGAxD9bdMPtFLrnz+rpi4bKXbBz48RGmiKTyh8=; b=n5cPfpud2aG3m/lG+uWesIL9SLlRk17i9BXaAOysv6BxMwdFOmyGNRogOtutTjmBJaF7Tg tT2T+ycRH2sXYGkYMDf88K+lX/0taF15e/4ccuSkGnk9qtgYkNvZjSzwZyFjCZtR3D/xfP cMay6LgQNdjSoCtr6RRIBIacWf7RnzFLqHwBIfV6u5lMtWjB4xEj1H+0lFUlojbML2VO71 3dLMi8BiFJ+uoFk221PVV1Gb2fj1mDmz30eUGuObr3z1JM5JVzRQ+Bxy1aCZMV6xszDI0Y YfPXj+JuDnvkFNa5WnbMT6HylAuO0bTUTFLN+JmKM7316pwg2TmCrmrWzV3JRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658355565; a=rsa-sha256; cv=none; b=nqpkwa1pu1GU79z7J78mHQ7+jvV+d1CUDXaQYdQtYnows2EOHWKyZWpdVr3uEL34aQHhrW 78D6Fe/DhxSNVaoIu080WaSGcGBvjEj5af9NApABsZFDPm/jkh2ejJzRdjKQt49oFRO4yh Il1kIZv19J3gA+1cKSaz/glOXoKJr4yuCYYDMY+wziw/sBoqmveKwPyAs83S78MHZaLBsp noDa9yyg/VCxCYPtshkFCsPVcpGq+CK/wLFTM3LEmvtphQGwXZlLWUHnrgaJZMCjVRHGUO ZZqcnMiSp2r2Mql7oUMPLVfszzDAL7CKqKm4y9c6HUYPnRGJC88D1+/h35tuyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 7/20/22 9:50 AM, Dimitry Andric wrote: > The branch main has been updated by dim: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3dbe05f61b65a73582aefdc2ee5a50ad2b4390ef > > commit 3dbe05f61b65a73582aefdc2ee5a50ad2b4390ef > Author: Dimitry Andric > AuthorDate: 2022-07-19 19:38:41 +0000 > Commit: Dimitry Andric > CommitDate: 2022-07-20 15:13:49 +0000 > > Suppress unused variable warning in mfi.c > > With clang 15, the following -Werror warnings are produced: > > sys/dev/mfi/mfi.c:3698:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable] > int timedout; > ^ > sys/dev/mfi/mfi.c:3742:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable] > int timedout = 0; > ^ > > Here, 'timedout' are variables that are only used when debugging, > requiring #if 0 statements to be modified. Mark the variables as > potentially unused, to suppress the warnings. > > MFC after: 3 days FWIW, when making similar changes recently if a variable was truly only ever used under an #ifdef or #if 0, I tended to move the variable under the #ifdef or #if 0 fully and tried to avoid using __unused unless the changes were going to be very invasive. -- John Baldwin