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

gh-112301: Use literal format strings in unicode_fromformat_arg#124203

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
encukou merged 3 commits intopython:mainfromencukou:sizemod
Sep 25, 2024

Conversation

@encukou
Copy link
Member

@encukouencukou commentedSep 18, 2024
edited by bedevere-appbot
Loading

This switches sprintf format strings in unicode_fromformat_arg to compile-time literals, avoiding-Wformat-nonliteral warnings and maybe even allowing optimizing thesprintf calls.

The macros aren't too readable so I'm generous with comments.

(Another option would be code generation, see the first commit.)

@rruuaanng
Copy link
Contributor

Maybe you should add NEWS.

@vstinner
Copy link
Member

Maybe you should add NEWS.

This change doesn't impact end users. I don't think that a NEWS entry is needed.

sprintf(buffer,fmt,va_arg(*vargs,int)) :
sprintf(buffer,fmt,va_arg(*vargs,unsignedint));
break;
caseF_LONG:DO_SPRINTS("l",long,unsignedlong)
Copy link
Member

Choose a reason for hiding this comment

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

Can you put thebreak here? Something like:

Suggested change
caseF_LONG:DO_SPRINTS("l",long,unsignedlong)
caseF_LONG:DO_SPRINTS("l",long,unsignedlong);break;

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

OK!
One line is 85 characters now, but I think it's most readable this way.

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.

LGTM

@encukouencukou merged commitda5855e intopython:mainSep 25, 2024
37 checks passed
@encukouencukou deleted the sizemod branchSeptember 25, 2024 17:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@encukou@rruuaanng@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp