ignoring implicit fallthrough on 4.20.11/ubuntu 18.04.2
- Dominant language
- C
- Stars
- 2.5k
- Forks
- 239
- PR merge metrics
- No merged PRs in 30d
Description
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;
Contributor guide
Research direction
Start with src/glb-director/shared_opt.c and src/glb-director/siphash24.c, focusing on the switch statements shown in the issue and the existing -Wimplicit-fallthrough workaround. Run the kernel build on the affected Ubuntu 18.04.2 setup, then verify that the build completes without the implicit-fallthrough warning shutting it down.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100