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

Build failing on newer GCCs due to new implicit fallthrough detection #97

Open
vancluever opened this issue Nov 23, 2017 · 4 comments
Open

Comments

@vancluever
Copy link

--- kern_rndpool.pico ---
src/buildrump.sh/src/lib/librump/../../sys/rump/../kern/kern_rndpool.c: In function 'rndpool_add_data':
src/buildrump.sh/src/lib/librump/../../sys/rump/../kern/kern_rndpool.c:184:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
    val = *buf++;
    ~~~~^~~~~~~~
src/buildrump.sh/src/lib/librump/../../sys/rump/../kern/kern_rndpool.c:185:3: note: here
   case 2:
   ^~~~
src/buildrump.sh/src/lib/librump/../../sys/rump/../kern/kern_rndpool.c:186:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
    val = val << 8 | *buf++;
    ~~~~^~~~~~~~~~~~~~~~~~~
src/buildrump.sh/src/lib/librump/../../sys/rump/../kern/kern_rndpool.c:187:3: note: here
   case 1:
   ^~~~
cc1: all warnings being treated as errors
*** [kern_rndpool.pico] Error code 1

This is my first time giving the project a spin, and also I'd imagine this specific problem is new-ish given that fallthrough detection was recently added to GCC. Adding -F CFLAGS=-Wimplicit-fallthrough=0 fixed it for me and got the build going again, but I thought I'd send this in so that it could be looked at and addressed in whatever way the project wants to address it (I'd imagine either by adding something specific to GCC or by adding the appropriate fallthrough metadata to the affected source files).

@vancluever
Copy link
Author

Update: Going further into the tutorial, looks like the problem also presents itself in rumpctrl too. To fix that I had to add support to pass through flags and add -F CWARNFLAGS=-Wno-error=format-truncation -F CWARNFLAGS=-Werror=implicit-fallthrough=0.

@yarwelp
Copy link

yarwelp commented Dec 13, 2017

@vancluever

To fix that I had to add support to pass through flags

Can you make a pull request on https://github.com/rumpkernel/rumpctrl for the changes you made for the rumpctrl build script to support pass through flags?

@K0zka
Copy link

K0zka commented Nov 17, 2018

failing on ubuntu 18.04 gcc version 7.3.0

@zatkh
Copy link

zatkh commented Dec 12, 2018

The same, fails on aarch64 Ubuntu 18.04 gcc 7.3.0. Adding the flags seems a short term solution, then all tests fails.

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

4 participants