-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Replace sscanf by sscanf_s on Windows? #1314
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
jagerman
added a commit
to jagerman/pybind11
that referenced
this issue
Mar 10, 2018
This reimplements the version check to avoid sscanf (which has reportedly started throwing warnings under MSVC, even when used perfectly safely -- pybind#1314). It also extracts the mostly duplicated parts of PYBIND11_MODULE/PYBIND11_PLUGIN into separate macros.
I'm testing a fix (linked above via commit message reference) for this by just building and checking for the major/minor version string prefix we expect (rather than doing any string-to-integer conversion at all). |
jagerman
added a commit
to jagerman/pybind11
that referenced
this issue
Mar 10, 2018
This reimplements the version check to avoid sscanf (which has reportedly started throwing warnings under MSVC, even when used perfectly safely -- pybind#1314). It also extracts the mostly duplicated parts of PYBIND11_MODULE/PYBIND11_PLUGIN into separate macros.
jagerman
added a commit
that referenced
this issue
Mar 11, 2018
This reimplements the version check to avoid sscanf (which has reportedly started throwing warnings under MSVC, even when used perfectly safely -- #1314). It also extracts the mostly duplicated parts of PYBIND11_MODULE/PYBIND11_PLUGIN into separate macros.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
PYBIND11_PLUGIN currently uses sscanf to parse the output of Py_GetVersion(). On MSVC, the use of sscanf triggers a warning:
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
The text was updated successfully, but these errors were encountered: