Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix formatting warnings for PyBytesWriter_Format#152

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromamolenaar:format-errors
Oct 3, 2025

Conversation

@amolenaar
Copy link
Contributor

Add C formatting warnings and fix declaration.

With extra formatting warnings, as we have in PyGObject, we get warnings like:

In file included from ../../gi/pygi-hashtable.c:21:../../subprojects/pythoncapi-compat/pythoncapi_compat.h:2537:41: warning: format string is not a string literal [-Wformat-nonliteral] 2537 |     PyObject *str = PyBytes_FromFormatV(format, vargs);      |                                         ^~~~~~

This PR adds formatting warnings (errors) to the test build and addresses theformat-nonliteral warning by providing an appropriate prototype for this function.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

I cannot reproduce the issue with GCC 15.2.1. What's your GCC version?

My test: runpython3 runtests.py --current -v withsetup.py changes.

@amolenaar
Copy link
ContributorAuthor

amolenaar commentedOct 3, 2025
edited
Loading

I was testing on macOS (15) with Python 3.13.7. I suppose Clang is a bit more picky (?).

I dida (test) CI run with only the extra warnings added tosetup.py, which fails .

@vstinner
Copy link
Member

I was testing on macOS (15) with Python 3.13.7. I suppose Clang is a bit more picky (?).

Ah you're using clang, ok. Using clang, I can reproduce the compiler warning.

amolenaar reacted with thumbs up emoji

@vstinnervstinner merged commit97f1582 intopython:mainOct 3, 2025
36 checks passed
@vstinner
Copy link
Member

Merged, thanks for the fix.

amolenaar reacted with thumbs up emoji

@vstinner
Copy link
Member

I'm surprised thatstatic inline int PyUnicodeWriter_Format(PyUnicodeWriter *writer, const char *format, ...) doesn't emit a similar warning.

@amolenaaramolenaar deleted the format-errors branchOctober 3, 2025 11:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@amolenaar@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp