build: Turn compiler warnings into errors only for our code#60
Merged
jrohel merged 1 commit intorpm-software-management:mainfrom Feb 2, 2026
Merged
Conversation
Building with GCC 16 failed on i686 architecture:
/builddir/build/BUILD/libpkgmanifest-0.5.9-build/libpkgmanifest-0.5.9/redhat-linux-build/bindings/python/libpkgmanifest/CMakeFiles/python3_common.dir/commonPYTHON_wrap.cxx: In function ‘void SWIG_TypeClientData(swig_type_info*, void*)’:
/builddir/build/BUILD/libpkgmanifest-0.5.9-build/libpkgmanifest-0.5.9/redhat-linux-build/bindings/python/libpkgmanifest/CMakeFiles/python3_common.dir/commonPYTHON_wrap.cxx:692:37: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
692 | for (cast = head; (cast - head) <= head->value; cast++) {
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
The cause is a bug in Swig-4.4.1 <swig/swig#3323>.
The bug is triggered by adding -Wextra -Werror to all compiler invocation,
stricter GCC, and building on 32-bit platforms where a ptrdiff_t type
has the same rank as the int type.
This patch works around the compiler warning by only applying the
-Werror option to code we maintain. Particullary, not applying to
Swig-generated code. In my opinion, this is more sustainable approach
than adding -Wno-warn-... exceptions to bindings/CMakeLists.txt
whenever the C++ compiler or Swig changes.
Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=2434767
Contributor
Author
|
The unrelated failure of Code Coverage CI task is addressed in #61. |
|
LGTM |
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.
Building with GCC 16 failed on i686 architecture:
The cause is a bug in Swig-4.4.1 swig/swig#3323. The bug is triggered by adding -Wextra -Werror to all compiler invocation, stricter GCC, and building on 32-bit platforms where a ptrdiff_t type has the same rank as the int type.
This patch works around the compiler warning by only applying the -Werror option to code we maintain. Particullary, not applying to Swig-generated code. In my opinion, this is more sustainable approach than adding -Wno-warn-... exceptions to bindings/CMakeLists.txt whenever the C++ compiler or Swig changes.
Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=2434767
A Fedora scratch build applying this fix https://koji.fedoraproject.org/koji/taskinfo?taskID=141685236.