src/CMakeLists.txt: add CFLAGS="-Werror" only in Debug builds#156
Merged
Conversation
New versions of GCC and Clang often bring fresh warnings that will break old releases when -Werror is in CFLAGS. It's still desirable to have -Werror enabled during development (where you can actually fix any errors that arise), so as a compromise, this commit changes the addition of -Werror to affect only "Debug" builds (this is what's documented in the README.md). Distributions and end users who make release builds with newer compilers will still see the warnings, they just won't be fatal.
Contributor
|
@orlitzky: Really appreciate your patch. |
Contributor
|
@orlitzky: One question. Do I have to create an official release build for Gentoo's integration? I'm curious that, does Gentoo only pull the official release of packages, or it pull the latest commit? |
Contributor
Author
|
Thank you! We prefer official releases, but there is no emergency. This will help avoid problems in the future, but the current GCC 16 and Clang 23 are working OK as far as I know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New versions of GCC and Clang often bring fresh warnings that will break old releases when
-Werroris inCFLAGS. It's still desirable to have-Werrorenabled during development (where you can actually fix any errors that arise), so as a compromise, this commit changes the addition of-Werrorto affect only "Debug" builds.Distributions and end users who make release builds with newer compilers will still see the warnings, they just won't be fatal.
Background: We have argtable3 in Gentoo linux, where installing a package means building it from source. For us
-Werroris a big headache, because when some newer GCC or clang adds a new warning, it prevents packages that use-Werrorfrom being installed. I recently added a small sed to our argtable3 package to strip-Werror, but thought it might be useful to others if it were added only in Debug builds.