title: Using strcpy() in Visual Studio 2013
body: <p>This is not a duplicate as you might think in first look.</p>
  
  <p>The <code>strcpy()</code> deprecation in Visual Studio is already known for a few years, as a difficulty when you try to port your C code from GCC to MSVC.</p>
  
  <p>In Visual Studio 2013, all the workarounds of defining <code>_CRT_SECURE_NO_WARNINGS</code> fail to solve the issue - the compilation is still failing on this error (It is called "warning", but it is actually an error that causes the compilation to fail).</p>
  
  <p>My question is whether there is an elegant way to solve it within the code?</p>
  
  <p>For example, such a macro would help me a lot:</p>
  
  <pre><code>#ifdef SOMETHING_THAT_INDICATES_ITS_MSVC_COMPILER
      Some macro that makes the following substitution:
          strcpy(dest, src) -&gt; strcpy_s(dest, strlen(src), src)
  #endif
  </code></pre>
  
  <p>Could you please tell me:</p>
  
  <ul>
  <li>If you think it is a good approach to solve this portability issue?</li>
  <li>How to correctly write such a macro?</li>
  <li>Any other recommendations?</li>
  </ul>