From: Dan Carpenter <error27@gmail.com>
To: Derek M Jones <derek@knosof.co.uk>
Cc: linux-sparse@vger.kernel.org
Subject: Re: declarations after a case statement
Date: Fri, 5 Jun 2026 08:50:37 +0300 [thread overview]
Message-ID: <aiJjrf-X8zB7fLWI@stanley.mountain> (raw)
In-Reply-To: <fe4a18e2-c398-4a3a-b8ca-be9e7ed33ba7@knosof.co.uk>
On Thu, Jun 04, 2026 at 03:21:00PM +0100, Derek M Jones wrote:
> Dan
>
> > Same thing for declaration after after a label.
>
> Sparse is correct. The usage you describe is a syntax error.
>
> A label may only appear on a statement, not a
> declaration
> https://c0x.shape-of-code.com/6.8.1.html
>
That's an awkward thing because GCC allows it and the kernel is
doing it.
net/mac80211/mesh_hwmp.c +373
switch (action) {
case MPATH_PREQ:
struct ieee80211_mesh_hwmp_preq_top *preq_elem_top =
(void *)hwmp_ie;
struct ieee80211_mesh_hwmp_preq_bottom *preq_elem_bottom =
ieee80211_mesh_hwmp_preq_get_bottom(hwmp_ie);
orig_addr = preq_elem_top->orig_addr;
regards,
dan carpenter
next prev parent reply other threads:[~2026-06-05 5:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 13:40 declarations after a case statement Dan Carpenter
2026-06-04 13:48 ` Dan Carpenter
2026-06-04 14:21 ` Derek M Jones
2026-06-05 5:50 ` Dan Carpenter [this message]
2026-06-05 10:43 ` Derek M Jones
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=aiJjrf-X8zB7fLWI@stanley.mountain \
--to=error27@gmail.com \
--cc=derek@knosof.co.uk \
--cc=linux-sparse@vger.kernel.org \
/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