-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Unable to compile on MSVC 2015 with SDL checking enabled: This function or variable may be unsafe. #149
Comments
snprintf could work. Otherwise, to disable you could do:
|
From a bit of reading looks like snprintf is a bit variable between os... might it be useful to just skip sprintf altogether and do it manually? |
heh - i messed up trying to rewrite a character ^^ @nlohmann can you take a look at this and if you're ok with it I can do a pull request, think its perhaps less shitty than alternatives. we can also probably take out include on cstdio but not positive on that. |
Hi @whackashoe, thanks for looking into the issue. I would love to see a pull request with your replacement! |
Replace sprintf with hex function, this fixes #149
https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp#L7658 I'm running into this issue again. Looks like there's another call to snprintf here. Looks like it was added 7.25.2020 |
When this library is compiled under MSVC 2015 with SDL checking on, compilation fails with this error:
C4996 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
The error occurs here at line 4694:
edit: This occurs with the latest release available from the releases list.
The text was updated successfully, but these errors were encountered: