public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: kernel test robot <lkp@intel.com>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-fsdevel@vger.kernel.org
Subject: Re: [viro-vfs:work.fd 11/19] fs/select.c:860:3: error: cannot jump from this goto statement to its label
Date: Fri, 7 Jun 2024 13:20:10 -0700	[thread overview]
Message-ID: <20240607202010.GA2270105@thelio-3990X> (raw)
In-Reply-To: <20240607152428.GY1629371@ZenIV>

On Fri, Jun 07, 2024 at 04:24:28PM +0100, Al Viro wrote:
> > >> fs/select.c:860:3: error: cannot jump from this goto statement to its label
> >      860 |                 goto out;
> >          |                 ^
> >    fs/select.c:862:12: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >      862 |         CLASS(fd, f)(fd);
> >          |                   ^
> >    13 warnings and 1 error generated.
> 
> Sigh...  That's why declarations in the middle of block really stink.
> Sadly, the use of CLASS() very much invites that kind of crap.
> For this series I decided to suppress the gag reflex and see how
> it goes, but... ouch.
> 
> Worse, neither current gcc, nor clang 14 catch that kind of crap ;-/

Hmmm, I am able to reproduce this with clang 14.0.6 from kernel.org [1]
with x86_64 allnoconfig:

$ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 allnoconfig fs/select.o
fs/select.c:860:3: error: cannot jump from this goto statement to its label
                goto out;
                ^
fs/select.c:862:12: note: jump bypasses initialization of variable with __attribute__((cleanup))
        CLASS(fd, f)(fd);
                  ^
1 error generated.

$ clang --version | head -1
ClangBuiltLinux clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)

It is a bug that GCC does not warn about this as far as I understand it:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951

[1]: https://mirrors.edge.kernel.org/pub/tools/llvm/

Cheers,
Nathan

  reply	other threads:[~2024-06-07 20:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07 10:47 [viro-vfs:work.fd 11/19] fs/select.c:860:3: error: cannot jump from this goto statement to its label kernel test robot
2024-06-07 15:24 ` Al Viro
2024-06-07 20:20   ` Nathan Chancellor [this message]
2024-06-07 20:30     ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240607202010.GA2270105@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox