-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Label in switch statement breaks Clang's fallthrough checker #36
Comments
Hello RageLtMan,
RageLtMan:
fs/aufs/opts.c:673:3: error: fallthrough annotation does not directly precede switch label
fallthrough;
^
:::
which appears to be happening because of the `add:` label below the fallthrough in:
```c
671 case Opt_prepend:
672 opt->add.bindex = 0;
673 fallthrough;
674 add: /* indented label */
675 case Opt_add
```
is there some sort of annotation needed to make this work or formatting of the label to make Clang happy?
Thanks for the report.
Since I don't use clang usually i'm not aware of that.
What will happen if you switch the line 674 and 675?
J. R. Okajima
|
That's what i ended up doing too commit 13e220c996fe2205c020ad4ca056acac183eb611
Author: RageLtMan <rageltman [at] sempervictus>
Date: Sun Feb 18 12:17:06 2024 -0500
AUFS: move label
diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c
index 20421440c004..1628137da28b 100644
--- a/fs/aufs/opts.c
+++ b/fs/aufs/opts.c
@@ -671,8 +671,8 @@ static int au_opt_br(struct super_block *sb, struct au_opt *opt,
case Opt_prepend:
opt->add.bindex = 0;
fallthrough;
- add: /* indented label */
case Opt_add:
+ add: /* indented label */
err = au_br_add(sb, &opt->add,
au_ftest_opts(opts->flags, REMOUNT));
if (!err) { |
RageLtMan:
That's what i ended up doing too
Ok, I will pick it up into aufs6.1 and spread all other branches.
Thanks.
J. R. Okajima
|
sfjro
pushed a commit
to sfjro/aufs-linux
that referenced
this issue
Feb 25, 2024
AUFS: move label See-also: sfjro/aufs-standalone#36 Signed-off-by: J. R. Okajima <[email protected]>
------- Blind-Carbon-Copy
From: "J. R. Okajima" ***@***.***>
To: ***@***.***
Subject: aufs6 GIT release (v6.8-rc5)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: ***@***.***>
Date: Mon, 26 Feb 2024 04:42:07 +0900
Message-ID: ***@***.***>
This is a minor release.
There is no change in aufs behaviour.
J. R. Okajima
- ----------------------------------------
- - aufs6-linux.git#aufs6.1
RageLtMan (1):
Fix Clang fallthrough error
- - aufs6-linux.git#aufs6.2..aufs6.x-rcN
addition to above
aufs: cosmetic, remove unnecessary 'unlikely'
- - aufs6-standalone.git#aufs6.1
ditto
- - aufs-util.git
nothing
…------- End of Blind-Carbon-Copy
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building 6.6.4 with clang, i'm seeing:
which appears to be happening because of the
add:
label below the fallthrough in:is there some sort of annotation needed to make this work or formatting of the label to make Clang happy?
The text was updated successfully, but these errors were encountered: