Skip to content
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

MSVC: error C4996: 'strcpy': This function or variable may be unsafe. #32

Closed
matbech opened this issue Aug 1, 2018 · 0 comments
Closed
Assignees
Labels

Comments

@matbech
Copy link
Contributor

matbech commented Aug 1, 2018

With MSVC:
include\tao\json\external\ryu.hpp(1117): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

I'm not sure if you want to add a workaround for MSVC or if the lib requires that _CRT_SECURE_NO_WARNINGS is defined?

My proposed workaround :

#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4996 )
#endif
                  std::strcpy( result, sign ? "-0.0" : "0.0" );
#ifdef _MSC_VER
#pragma warning( pop )
#endif
@d-frey d-frey added the bug label Aug 1, 2018
@ColinH ColinH closed this as completed in 663f82f Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants