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

sample2.cc generates warning on windows vs2005 #45

Closed
GoogleCodeExporter opened this issue Aug 7, 2015 · 5 comments
Closed

sample2.cc generates warning on windows vs2005 #45

GoogleCodeExporter opened this issue Aug 7, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. compile sample2.cc with Visual Studio 2005

Output from compiler is:

cc(52) : warning C4996: 'strcpy' was declared deprecated
        c:\program files\microsoft visual studio 8\vc\include\string.h(73) : see declaration of 'strcpy'
        Message: 'This function or variable may be unsafe. Consider using strcpy_s instead. To disable 
deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'

I don't want to have to #define _CRT_SECURE_NO_DEPRECATE


Original issue reported on code.google.com by keith....@gmail.com on 6 Oct 2008 at 6:22

Attachments:

@GoogleCodeExporter
Copy link
Author

my suggested fix is one line:  change strcpy, that MSVS is complaining about, 
to memcpy.

old:
strcpy(clone, c_string);

new:
memcpy(clone, c_string, len + 1);

patch file is attached.

Original comment by keith....@gmail.com on 6 Oct 2008 at 6:43

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by shiq...@gmail.com on 8 Oct 2008 at 9:10

  • Added labels: OpSys-Windows, Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Keith, 
I am putting the change in, together with another sample fix (that one for VS 
7.1).
They may take a week or two to filter to svn, though -- we are busy with the 
other
things right now.

Original comment by vladlosev on 9 Oct 2008 at 1:02

@GoogleCodeExporter
Copy link
Author

Original comment by shiq...@gmail.com on 12 Oct 2008 at 3:21

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Fixed in revision 135.

Original comment by vladlosev on 22 Nov 2008 at 6:08

  • Changed state: Fixed

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

No branches or pull requests

1 participant