Skip to content

sprintf deprecation warning on macOS for datetimemodule #103733

Closed as not planned
Closed as not planned

Description

@corona10

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);

Activity

  1. corona10 commented on Apr 24, 2023

    @corona10
    MemberAuthor
  2. corona10 commented on Apr 24, 2023

    @corona10
    MemberAuthor

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

  3. pganssle commented on Apr 24, 2023

    @pganssle
    Member

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

  4. arhadthedev commented on Apr 24, 2023

    @arhadthedev
    Member

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

  5. corona10 commented on Apr 24, 2023

    @corona10
    MemberAuthor

    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.

  6. arhadthedev commented on Apr 24, 2023

    @arhadthedev
    Member

    A parent issue: A duplicate of gh-101703.

  7. sobolevn commented on Apr 24, 2023

    @sobolevn
    Member

    Thanks a lot, @arhadthedev!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions