Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprintf deprecation warning on macOS for datetimemodule #103733

Closed
corona10 opened this issue Apr 24, 2023 · 7 comments
Closed

sprintf deprecation warning on macOS for datetimemodule #103733

corona10 opened this issue Apr 24, 2023 · 7 comments
Labels
easy OS-mac type-feature A feature request or enhancement

Comments

@corona10
Copy link
Member

corona10 commented Apr 24, 2023

How to reproduce

./configure --with-address-sanitizer && make

Deprecation warning

./Modules/_datetimemodule.c:1566:9: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
        sprintf(freplacement, "%06d", 0);
@corona10 corona10 added type-feature A feature request or enhancement OS-mac easy labels Apr 24, 2023
@corona10
Copy link
Member Author

cc @ned-deily @pganssle

@corona10
Copy link
Member Author

I expect that the solution will not be hard, so I label the issue as easy

@pganssle
Copy link
Member

Seems like a good sprint issue? Assuming we can detect this in the tests easily or otherwise verify the fix.

@arhadthedev
Copy link
Member

arhadthedev commented Apr 24, 2023

Can PyOS_snprintf() be a drop-in replacement here? (edit: just asking, I will not take this issue).

@corona10
Copy link
Member Author

corona10 commented Apr 24, 2023

Seems like a good sprint issue? Assuming we can detect this in the tests easily or otherwise verify the fix.

I will be happy if it can be used for the sprint issue. But I leave tomorrow, so some of the core dev can do it on the sprint.

@arhadthedev
Copy link
Member

arhadthedev commented Apr 24, 2023

A parent issue: A duplicate of gh-101703.

@sobolevn
Copy link
Member

sobolevn commented Apr 24, 2023

Thanks a lot, @arhadthedev!

I will highly appreciate a review of #101729 :)
It seems ready to me.

@terryjreedy terryjreedy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy OS-mac type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants