-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Let's get rid of sprintf() #101703
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
Comments
There are 49 hits in our .c code + some in externals. |
Interesting, there were issues with portability of |
CC. @eryksun |
Supported builds of Python 3.5+ on Windows use Visual Studio 2015+ and the Universal C Runtime (UCRT), for which
|
I closed #103733 as duplicate of this. |
@terryjreedy @sobolevn Can this be closed? I haven't seen those warnings in a while, though I see plenty of sprintf() calls in the code still. |
I have no involvement with C code, so fine with me. @serhiy-storchaka ? |
I've tried to compile CPython with explicit
Not sure why this warning is gone. |
Well, we risk that when the next version your toolchain of choice is updated, the warnings will reappear. IMO we might as well fix them. @sobolevn's PR was a good start, but only needed to be split in more manageable chunks. |
I can redo some parts of it, there were rather easy. I'll start with them today. |
On macOS with Xcode 14 we now get warnings like these:
While we can prove to ourselves that these specific
sprintf()
calls are safe, the warnings are annoying, but disabling them would also disable other, more useful warnings (or so @Yhg1s tells me on Discord). So let's just switch these tosnprintf()
.Linked PRs
PyOS_snprintf
instead ofsprintf
#101729The text was updated successfully, but these errors were encountered: