Skip to content

gh-90949: Fix an "unused function" compiler warning introduced in GH-139234#139558

Merged
picnixz merged 1 commit intopython:mainfrom
hartwork:post-139368
Oct 4, 2025
Merged

gh-90949: Fix an "unused function" compiler warning introduced in GH-139234#139558
picnixz merged 1 commit intopython:mainfrom
hartwork:post-139368

Conversation

@hartwork
Copy link
Copy Markdown
Contributor

@hartwork hartwork commented Oct 4, 2025

Adds on top of #139368 to fix a compiler warning that did not exist prior to the work on #90949.

CC @picnixz

The symptom was:
> ./Modules/pyexpat.c:202:1: warning: ‘set_invalid_arg’ defined but not used [-Wunused-function]
>   202 | set_invalid_arg(pyexpat_state *state, xmlparseobject *self, const char *errmsg)
>       | ^~~~~~~~~~~~~~~
@picnixz picnixz changed the title gh-90949: Amend GH-139368 Oct 4, 2025
@picnixz
Copy link
Copy Markdown
Member

picnixz commented Oct 4, 2025

I assume the compiler warning is "unused function" right?

@hartwork
Copy link
Copy Markdown
Contributor Author

hartwork commented Oct 4, 2025

I assume the compiler warning is "unused function" right?

@picnixz yes, I put details into the commit message.

@picnixz
Copy link
Copy Markdown
Member

picnixz commented Oct 4, 2025

Oups, I didn't see it. My bad. Thanks for the fix!

@picnixz picnixz changed the title gh-90949: Fix an "unused function" compiler warning introduced in GH-139368 Oct 4, 2025
@hartwork
Copy link
Copy Markdown
Contributor Author

hartwork commented Oct 4, 2025

@picnixz no worries, glad I could help. (The warning showed while working on the backports yesterday where the bundled Expat is not yet at >=2.7.2.)

@picnixz picnixz enabled auto-merge (squash) October 4, 2025 14:02
@picnixz picnixz merged commit fc48a3c into python:main Oct 4, 2025
51 checks passed
danigm pushed a commit to openSUSE-Python/cpython that referenced this pull request Oct 7, 2025
pythonGH-139234 (python#139558)

Fix a compiler warning `-Wunused-function` after f04bea4.

The `set_invalid_arg` function in `Modules/pyexpat.c` may be unused if the underlying Expat
version is less than 2.4.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants