From: Jeff King Date: Wed, 31 Aug 2022 15:12:14 GMT Subject: Re: [PATCH] ci: update 'static-analysis' to Ubuntu 22.04 Message-ID: In-Reply-To: <220829.86k06r2v6z.gmgdl@evledraar.gmail.com> On Mon, Aug 29, 2022 at 12:29:09PM +0200, Ævar Arnfjörð Bjarmason wrote: > My reading of this is that you're misimpression that unused.cocci and > Jeff's UNUSED macro are two ways to the same end-goal, and that if we > keep the macro we could lose the coccinelle rule. Ah, I didn't think of that, but yeah, that would explain Junio's position a bit more. > But they're doing completely orthogonal checks, the unused.cocci is > finding code that's *actually used* accordingn to the compiler, but which > we know results in code that's functionally unused. Right. They're two separate types of "unused", and they should actually complement each other (e.g., if we drop an unused strbuf parameter, then a calling function may find that it is now doing nothing but init/release on the strbuf). So we'd want both. -Peff