rumpkernel / rumprun

The Rumprun unikernel and toolchain for various platforms
Other
1.14k stars 128 forks source link

Add the -Wimplicit-fallthrough=0 flag to allow compiling with GCC7 #112

Closed najamelan closed 6 years ago

najamelan commented 6 years ago

GCC7 comes with a new warning "implicit-fallthrough" which will prevent building the netbsd-src.

For more information: https://dzone.com/articles/implicit-fallthrough-in-gcc-7

I don't know if this is the best way to deal with it, but it works ;-)

najamelan commented 6 years ago

fixes https://github.com/rumpkernel/src-netbsd/issues/4 see also: https://github.com/rumpkernel/rumprun/issues/111

gandro commented 6 years ago

Thanks a lot! Unfortunately, this seems to break older versions of gcc (e.g. 4.8.4 reports gcc: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’), as they do not understand this flag. Would it be possible to make it conditional?

najamelan commented 6 years ago

This time the tests pass, note that the gcc version check is not done the same way then elsewhere in the build script, but this seemed cleaner and more readable to me. I found the technique on: https://stackoverflow.com/questions/5188267/checking-the-gcc-version-in-a-makefile

gandro commented 6 years ago

Ah, is this only needed for buildrump.sh? Then it should eventually be added there instead (and it might already be fixed in netbsd-src, but we're currently using an older checkout).

In any case, I'll happily merge this for now.