Re: [PATCH] vduse: Fix error around jumping over a __cleanup() variable
From: Nathan Chancellor
Date: Sat Jun 13 2026 - 12:28:29 EST
On Thu, Jun 11, 2026 at 11:03:46AM +0100, David Laight wrote:
> On Wed, 10 Jun 2026 12:16:49 -0700
> Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> > When building with clang, there is an error in vduse_vq_kick() from
> > attempting to jump over a variable declared with the cleanup attribute
> > using goto:
> .
> > Jumping over a variable declared with the cleanup attribute does not
> > prevent the cleanup function from running, it would just result in the
> > variable being passed uninitialized to the cleanup function .clang
> > errors instead of generating the invalid code, unlike GCC.
>
> Does the same apply to variables allocated inside switch statements?
> I'm sure I've seen one that wasn't inside an extra block.
Yes:
https://lore.kernel.org/20251002233627.GA3978676@ax162/
--
Cheers,
Nathan