Skip to content

fix(python_plugins_loader): suppress -Wconversion for SWIG-generated code#2673

Merged
kontura merged 1 commit intorpm-software-management:mainfrom
tchaikov:fix-swig-wconversion-fmt12
Apr 5, 2026
Merged

fix(python_plugins_loader): suppress -Wconversion for SWIG-generated code#2673
kontura merged 1 commit intorpm-software-management:mainfrom
tchaikov:fix-swig-wconversion-fmt12

Conversation

@tchaikov
Copy link
Copy Markdown
Contributor

@tchaikov tchaikov commented Apr 3, 2026

The SWIG-generated swigpyrun.h contains an implicit size_t to int narrowing in SWIG_Hash():

  rem -= sizeof(unsigned int);

This triggers -Werror=conversion with GCC 16 (not Clang). The bug is fixed in SWIG master (swig/swig#3287), but unfortunately, not in any released SWIG version at the time of writing (see
swig/swig@296fe5e, 4.4.1 narrowly missed it).

This warning was previously masked by a leaked -Wconversion diagnostic suppression in fmt < 12 (fmtlib/fmt#4588). fmt 12 properly scoped the suppression, exposing this pre-existing SWIG issue.

Add -Wno-conversion to the existing warning suppression list for the python_plugins_loader target, consistent with the existing approach of suppressing warnings in SWIG-generated code that we don't control.

We can revert this change once the downstream packaging picks up the SWIG fix.

…code

The SWIG-generated swigpyrun.h contains an implicit size_t to int
narrowing in SWIG_Hash():

  rem -= sizeof(unsigned int);

This triggers -Werror=conversion with GCC 16 (not Clang). The bug is
fixed in SWIG master (swig/swig#3287), but
unfortunately, not in any released SWIG version at the time of writing
(see
swig/swig@296fe5e,
4.4.1 narrowly missed it).

This warning was previously masked by a leaked -Wconversion diagnostic
suppression in fmt < 12 (fmtlib/fmt#4588).
fmt 12 properly scoped the suppression, exposing this pre-existing
SWIG issue.

Add -Wno-conversion to the existing warning suppression list for
the python_plugins_loader target, consistent with the existing
approach of suppressing warnings in SWIG-generated code that we
don't control.

We can revert this change once the downstream packaging picks up the
SWIG fix.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov requested a review from a team as a code owner April 3, 2026 01:38
@tchaikov tchaikov requested review from fhbash and removed request for a team April 3, 2026 01:38
@tchaikov
Copy link
Copy Markdown
Contributor Author

tchaikov commented Apr 3, 2026

FWIW, a bz was filed at https://bugzilla.redhat.com/show_bug.cgi?id=2454313

Copy link
Copy Markdown
Contributor

@kontura kontura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, thanks!

@kontura kontura added this pull request to the merge queue Apr 5, 2026
Merged via the queue into rpm-software-management:main with commit 5122f83 Apr 5, 2026
19 checks passed
@tchaikov tchaikov deleted the fix-swig-wconversion-fmt12 branch April 5, 2026 07:20
@ppisar ppisar added the downstream Also reported in Jira or Bugzilla label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

downstream Also reported in Jira or Bugzilla

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants