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

Fix building with ccache. #36583

Merged
merged 2 commits into from
Dec 31, 2019
Merged

Fix building with ccache. #36583

merged 2 commits into from
Dec 31, 2019

Conversation

BevapDin
Copy link
Contributor

SUMMARY: Build "Fix building with ccache"

When building with ccache enabled (make CCACHE=1), I get the following error (from several files, and several switch statements):

src/character.cpp: In member function ‘void Character::heal(body_part, int)’:
src/character.cpp:6276:25: error: this statement may fall through [-Werror=implicit-fallthrough=]

Turns out, ccache removes the comments before passing them to the compiler. So the /* fallthrough */ comment that prevents that error normally gets removed as well.

Adding the -C switch prevents that.

When building with ccache enabled, it removes the comments before passing them to the compiler. So the `/* fallthrough */` comment that prevents certain warnings is removed as well.

Adding the `-C` switch prevents that removal and the comments remains and the warning from the compiler does not appear.
@kevingranade
Copy link
Member

Ahhhh!!!! finally! I was trying to figure this out well over a year ago and was never able to.

This instructs ccache directly. The former version relied on gcc to interpret the "-C" flag, but clang apparently does not understand it.
@BevapDin
Copy link
Contributor Author

I changed it: the "-C" flag was specific to gcc, and clang apparently did not get it. New version instructs ccache directly.

But be aware: this only works since ccache v3.5.1.

@ZhilkinSerg ZhilkinSerg added the Code: Build Issues regarding different builds and build environments label Dec 31, 2019
@ZhilkinSerg ZhilkinSerg merged commit 0e50d26 into CleverRaven:master Dec 31, 2019
@BevapDin BevapDin deleted the zsz branch December 31, 2019 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants