-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
cmake: fix fallthrough warnings with ccache #12827
Conversation
CMakeLists.txt
Outdated
|
||
# To prevent "// fallthrough" comments from being stripped by the preprocessor | ||
# before ccache looks at the cache. | ||
set(CCACHE_CPP2 "yes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would have to be set as an environment variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but it seems to work 🤷♂️ ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this goes in, just let me know what needa to change in docs and env setup scripts - if anything:-)
@julianoes I tried running this on my machine andt does not seem to help. If I build px4_fmu-v4_default, I still get the errors about implicit fallthrough |
Maybe @dagar was right and I wasn't testing this correctly, let me check again. |
It turns out that we're getting compile warnings with arm-none-eabi-gcc 7.2.1 when used with ccache about implicit fallthroughs. By setting CCACHE_CPP2 we force ccache to look at the whole file not just the stripped version.
4b01c07
to
b6de5ed
Compare
@baumanta check again please. |
@julianoes |
@dagar let's get this in. |
A couple minor concerns.
|
|
|
@MaEtUgR @nicovanduijn maybe it makes sense to continue the discussion here, as this proposes a more reasonable solution. I did a bisect and the warning appears for all commits after: [d41f72f] Re-enable implicit-fallthrough warning |
Aha! Still odd why it wasn't caught by CI. |
Downloaded and installed newest ccache from https://launchpad.net/ubuntu/bionic/amd64/ccache/3.4.1-1 This fixed the issue for me on 16.04. |
@jkflying let's add that to the ubuntu.sh script as well as the scripts in the Devguide. (I know it's annoying that we currently have two scripts). |
@jkflying Confirmed:
fixes the problem instantly even without cleaning the cache. cmake check for new ccache version with a message telling the user how to do so? |
It turns out that we're getting compile warnings with arm-none-eabi-gcc 7.2.1 when used with ccache about implicit fallthroughs. By setting CCACHE_CPP2 we force ccache to look at the whole file not just the stripped version.
Fixes #12813, closes #12820.