Skip to content

Replace sscanf by sscanf_s on Windows? #1314

@anntzer

Description

@anntzer

Issue description

PYBIND11_PLUGIN currently uses sscanf to parse the output of Py_GetVersion(). On MSVC, the use of sscanf triggers a warning:

warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

Obviously 1) the warning is spurious (the literal format used is totally safe) and 2) the programmer could, indeed, set _CRT_SECURE_NO_WARNINGS; but still, perhaps pybind11 could just use sscanf_s there?

Reproducible example code

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions