Skip to content
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

ignoring implicit fallthrough on 4.20.11/ubuntu 18.04.2 #73

Open
openhacker opened this issue Jul 28, 2019 · 5 comments
Open

ignoring implicit fallthrough on 4.20.11/ubuntu 18.04.2 #73

openhacker opened this issue Jul 28, 2019 · 5 comments

Comments

@openhacker
Copy link

builds generate a warning which shuts down....

There's a -Wimplicit-fallthrough flag in kernel builds.

This gets around the problem

diff --git a/src/glb-director/shared_opt.c b/src/glb-director/shared_opt.c
index 46e9307..0c93355 100644
--- a/src/glb-director/shared_opt.c
+++ b/src/glb-director/shared_opt.c
@@ -48,6 +48,8 @@ void get_options(char *config_file, char *forwarding_table, int argc,
{"debug", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}};

+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+
while ((opt = getopt_long(argc, argv, ":c:t:v", long_options, NULL)) !=
-1)
switch (opt) {
diff --git a/src/glb-director/siphash24.c b/src/glb-director/siphash24.c
index ebe785c..e3cda35 100644
--- a/src/glb-director/siphash24.c
+++ b/src/glb-director/siphash24.c
@@ -110,7 +110,7 @@ int siphash(uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k)

            v0 ^= m;                                                                                                                                                
    }                                                                                                                                                               

+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
switch (left) {
case 7:
b |= ((uint64_t)in[6]) << 48;

@theojulienne
Copy link
Contributor

Thanks for reporting this! Would you mind creating a PR against this repo for the change? That'll make sure you're correctly attributed as the author of the change 😀

@openhacker
Copy link
Author

openhacker commented Aug 3, 2019 via email

@theojulienne
Copy link
Contributor

Should I fork a copy and then send the pull request?

Yep, that would be perfect!

@openhacker
Copy link
Author

openhacker commented Aug 11, 2019 via email

@ravisinghsfbay
Copy link
Contributor

Filed PR #84 which should address this issue using a slightly different approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants