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

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

Merged
merged 2 commits into from
Jan 5, 2018

Conversation

najamelan
Copy link
Contributor

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 ;-)

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
@najamelan
Copy link
Contributor Author

fixes rumpkernel/src-netbsd#4
see also: #111

@gandro
Copy link
Member

gandro commented Jan 4, 2018

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?

This should prevent older gcc versions from choking on unknown argument.

I have not tested this, just wrote the code directly on github. Use with caution.
@najamelan
Copy link
Contributor Author

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
Copy link
Member

gandro commented Jan 5, 2018

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.

@gandro gandro merged commit 8fe40c8 into rumpkernel:master Jan 5, 2018
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

Successfully merging this pull request may close these issues.

2 participants