{"id":4283,"date":"2009-09-01T12:29:00","date_gmt":"2009-09-01T12:29:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2009\/09\/01\/compiler-warning-c4789\/"},"modified":"2019-02-18T18:45:48","modified_gmt":"2019-02-18T18:45:48","slug":"compiler-warning-c4789","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/compiler-warning-c4789\/","title":{"rendered":"Compiler Warning C4789"},"content":{"rendered":"<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">When Visual Studio 2010 ships, it will have improvements to warning C4789; allowing it to catch more cases of buffer overrun. This blog post will cover what C4789 warns about, and how to resolve the warning.<\/font><\/p>\n<h2><span><font size=\"5\"><font color=\"#365f91\"><font face=\"Cambria\">What does C4789 mean?<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">When compiling your source file, you may receive the warning: &ldquo;warning C4789: destination of memory copy is too small.&rdquo;<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">This message means that the compiler has detected a possible buffer overrun in your code.<\/font><\/p>\n<h3><span><font size=\"3\"><font color=\"#4f81bd\"><font face=\"Cambria\">Example 1<\/p>\n<p><\/font><\/font><\/font><\/span><\/h3>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Let&rsquo;s say we have the source file a.cpp that contains the following:<\/font><\/p>\n<p class=\"MsoNormal\"><span>1:<span> #include<\/span> <span>&lt;memory.h&gt;<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span>2:<span><\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span>3: <span>int<\/span> p[1];<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>4:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>5: <span>void<\/span> bar() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>6:&nbsp;&nbsp;&nbsp;&nbsp; memset(&amp;p[1], 1, <span>sizeof<\/span>(<span>int<\/span>));<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>7: }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">From the &rdquo;Visual Studio 2008 Command Prompt&rdquo;, if you compile this with the command:<\/font><\/p>\n<p class=\"CommandLine\"><span><font size=\"3\">cl \/c \/O2 a.cpp<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You will receive the warning:<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">a.cpp(6) : warning C4789: destination of memory copy is too small<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">For the example above, the compiler has detected a buffer overrun for the variable &lsquo;p&rsquo;. &#8216;p&#8217; has been allocated as an array with one element. Arrays are zero-indexed, so the memset on line 6 is taking the address of the <i>second<\/i> element of an array; this means that we are actually writing to memory outside the array, corrupting memory!<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">In this case, the user most likely meant to memset the first element, and thus to fix this issue, the memset would be changed to <\/font><\/p>\n<p class=\"MsoNormal\"><span>memset(&amp;p<b>[0]<\/b>, 1, <span>sizeof<\/span>(<span>int<\/span>));<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<h2><span><font size=\"5\"><font color=\"#365f91\"><font face=\"Cambria\">Typical User Scenarios<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">In practice, a lot of buffer overruns will not be as obvious as Example 1, so I&rsquo;ll provide some more examples to help you in your investigations.<\/font><\/p>\n<h3><span><font size=\"3\"><font color=\"#4f81bd\"><font face=\"Cambria\">Example 2<\/p>\n<p><\/font><\/font><\/font><\/span><\/h3>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Let&rsquo;s say we have the source file a.cpp that contains the following:<\/font><\/p>\n<p class=\"MsoNormal\"><span>1:&nbsp; <span>short<\/span> G1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>2:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>3:&nbsp; <span>void<\/span> foo(<span>int<\/span> * x)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>4:&nbsp; {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *x = 5;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>6:&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>7: <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>8:&nbsp; <span>void<\/span> bar() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>9:&nbsp;&nbsp;&nbsp;&nbsp; foo((<span>int<\/span> *)&amp;G1);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>10: }<\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">From the &rdquo;Visual Studio <b>2010<\/b> Command Prompt&rdquo;, if you compile this with the command:<\/font><\/p>\n<p class=\"CommandLine\"><span><font size=\"3\">cl \/c \/O2 a.cpp<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You will receive the warning:<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">a.cpp(9) : warning C4789: destination of memory copy is too small<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">In this example, we&rsquo;ve created a variable &#8216;G1&#8217; of si\nze short (which is only two bytes), but we&rsquo;ve taken the address of it and casted it to &#8216;int *&#8217; to pass to &#8216;foo&rsquo;. &#8216;foo&#8217; then writes 4 bytes to the memory location pointed at by &#8216;x&rsquo;. As &#8216;G1&#8217; is only 2 bytes in length, the store &ldquo;*x = 5&rdquo; will write past &#8216;G1&#8217;, resulting in a buffer overrun. <\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">There are a couple of important things to note about this example. This buffer overrun will only be caught with the improvements made in Visual Studio 2010. Also, this warning is caught by inlining &#8216;foo&#8217; into &#8216;bar&#8217;. This means that this buffer overrun is only caught when optimizations are enabled.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">To fix the buffer overrun in Example 2, we declare &#8216;G1&#8217; as int. If that isn&rsquo;t an option, we can create a new variable to pass to &lsquo;foo,&rsquo; and assign that variable to &lsquo;G1&rsquo; (which truncates the int to a short):<\/font><\/p>\n<p class=\"MsoNormal\"><span>&nbsp;&nbsp; <span>int<\/span> y;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>&nbsp;&nbsp; foo(&amp;y);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>&nbsp;&nbsp; G1 = y;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<h3><span><font size=\"3\"><font color=\"#4f81bd\"><font face=\"Cambria\">Example 3<\/p>\n<p><\/font><\/font><\/font><\/span><\/h3>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Let&rsquo;s say we have the source file a.cpp that contains the following:<\/font><\/p>\n<p class=\"MsoNormal\"><span>1:&nbsp; <span>int<\/span> G1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>2:&nbsp; <span>int<\/span> G2;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>3:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>4:&nbsp; <span>void<\/span> foo(<span>int<\/span> ** x)<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>5:&nbsp; {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>6:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *x = &amp;G2;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>7:&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>8:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>9:&nbsp; <span>void<\/span> bar() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>10:&nbsp;&nbsp;&nbsp;&nbsp; foo((<span>int<\/span> *)&amp;G1);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>11: }<\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">From the &rdquo;Visual Studio 2010 <b>X64<\/b> Cross Tools Command Prompt&rdquo;, if you compile this with the command:<\/font><\/p>\n<p class=\"CommandLine\"><span><font size=\"3\">cl \/c \/O2 a.cpp<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You will receive the warning:<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">a.cpp(10) : warning C4789: destination of memory copy is too small<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">This example is exactly like Example 2 with a key difference. We&rsquo;ve casted &ldquo;int&rdquo; to &ldquo;int *&rdquo;. On x86, this is a harmless cast (int and int * are the same size, 4 bytes). However, on x64, &ldquo;int&rdquo; is 4 bytes, and &ldquo;int *&rdquo; is 8 bytes, so this code is no longer correct when this code is run on x64.<\/font><\/p>\n<h2><span><font size=\"5\"><font color=\"#365f91\"><font face=\"Cambria\">C4789 False Positives<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You may hit cases of C4789 where the warning is incorrect. This can happen because the compiler detects a buffer overrun along a code path that will never fire. <\/font><\/p>\n<h3><span><font size=\"3\"><font color=\"#4f81bd\"><font face=\"Cambria\">Example 4<\/p>\n<p><\/font><\/font><\/font><\/span><\/h3>\n<p class=\"MsoNormal\"><span>1:&nbsp; <span>__int64<\/span> G1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>2:&nbsp; <span>int<\/span> lengthOfG1 = 8;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>3:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>4:&nbsp; <span>void<\/span> foo(<span>char<\/span> * x, <span>int<\/span> len) {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>if<\/span> (len &gt; 8) {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>6:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x[8] = 1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>7:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>8:&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>9:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>10: <span>void<\/span> bar() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>11:&nbsp;&nbsp;&nbsp;&nbsp; foo((<span>char<\/span> *)&amp;G1, lengthOfG1);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>12: }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">From the &rdquo;Visual Studio 2010 Command Prompt&rdquo;, if you compile this with the command:<\/font><\/p>\n<p class=\"CommandLine\"><span><font size=\"3\">cl \/c \/O2 a.cpp<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You will receive the warning:<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">a.cpp(11) : warning C4789: destination of memory copy is too small<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">In this example, the compiler thinks that &lsquo;G1&rsquo; can be buffer overrun because of &ldquo;x[8] = 1&rdquo; would assign outside of the size of &lsquo;G1.&rsquo; However, as long as &lsquo;lengthOfG1&rsquo; is the correct length of &lsquo;G1,&rsquo; &ldquo;x[8] = 1&rdquo; will never fire for &lsquo;G1,&rsquo; and thus a buffer overrun will never occur.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">For some of these false positives, the only option will be to disable the warning. In this particular example, however, changing &#8220;int lengthOfG1 = 8&rdquo; to<\/font><\/p>\n<p class=\"MsoNormal\"><span>const int<\/span><span> lengthOfG1 = 8; <\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">would solve the problem.<\/font><\/p>\n<h2><span><font size=\"5\"><font color=\"#365f91\"><font face=\"Cambria\">Workarounds<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">If you have proven that the warning is a false positive, there are a couple of different ways to disable the warning.<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">1.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Disable the warning for one function (recommended)<\/font><\/p>\n<p class=\"MsoListParagraph\"><span><span><font face=\"Calibri\" size=\"3\">2.<\/font><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><font face=\"Calibri\" size=\"3\">Disable the warning for all functions<\/font><\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Disable the warning for one function<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">The compiler allows you to disable a warning for a particular function. This is done by putting<\/font><\/p>\n<p class=\"MsoNormal\"><span>#pragma<\/span><span> <span>warning<\/span> ( <span>disable<\/span> : 4789 )<\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">before the function, and putting<\/font><\/p>\n<p class=\"MsoNormal\"><span>#pragma<\/span><span> <span>warning<\/span> ( <span>default<\/span> : 4789 )<\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">after the function. This will disable the warning (in this case warning 4789) for that function (and any functions which inline it).<\/font><\/p>\n<h3><span><font size=\"3\"><font color=\"#4f81bd\"><font face=\"Cambria\">Example 5<\/p>\n<p><\/font><\/font><\/font><\/span><\/h3>\n<p class=\"MsoNormal\"><span>1:&nbsp; <span>__int64<\/span> G1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>2:&nbsp; <span>int<\/span> lengthOfG1 = 8;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>3:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>4:&nbsp; <span>#pragma<\/span> <span>warning<\/span> ( <span>disable<\/span> : 4789 )<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>5:&nbsp; <span>void<\/span> foo(<span>char<\/span> * x, <span>int<\/span> len) {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>6:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>if<\/span> (len &gt; 8) {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>7:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x[8] = 1;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>8:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>9:&nbsp; }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>10: <span>#pragma<\/span> <span>warning<\/span> ( <span>default<\/span> : 4789 )<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>11:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>12: <span>void<\/span> bar() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>13:&nbsp;&nbsp;&nbsp;&nbsp; foo((<span>char<\/span> *)&amp;G1, lengthOfG1);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>14: }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>15:<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>16: <span>void<\/span> bar1() {<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>17:&nbsp;&nbsp;&nbsp;&nbsp; foo((<span>char<\/span> *)&amp;G1, 9);<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>18: }<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">With the #pragma around &lsquo;foo,&rsquo; you will receive no warnings; while without it you will receive the warnings:<\/font><\/p>\n<p class=\"MsoNormal\"><font size=\"3\"><font face=\"Calibri\">a.cpp(13) : warning C4789: destination of memory copy is too small<span><\/p>\n<p><\/span><\/font><\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">a.cpp(17) : warning C4789: destination of memory copy is too small<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">You can also choose to disable the warning for one of the functions where the warning occurs. In the example above, we could put the #pragma around &lsquo;bar&rsquo; instead of &lsquo;foo&rsquo;, and then we&rsquo;d eliminate the warning for line 13, but still receive the warning on line 17.<\/font><\/p>\n<h2><span><font size=\"4\"><font color=\"#4f81bd\"><font face=\"Cambria\">Disable the warning for all functions<\/p>\n<p><\/font><\/font><\/font><\/span><\/h2>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">If you need to ignore warning 4789 completely, you can specify \/wd4789 on the command line.<\/font><\/p>\n<p class=\"CommandLine\"><span><font size=\"3\">cl \/c \/O2 <b>\/wd4789<\/b> a.cpp<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">This option isn&rsquo;t recommended as it will hide potentional buffer overruns in your code.<\/font><\/p>\n<p class=\"MsoNormal\">\n<p><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Visual Studio 2010 ships, it will have improvements to warning C4789; allowing it to catch more cases of buffer overrun. This blog post will cover what C4789 warns about, and how to resolve the warning. What does C4789 mean? &nbsp; When compiling your source file, you may receive the warning: &ldquo;warning C4789: destination of [&hellip;]<\/p>\n","protected":false},"author":289,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26,27],"class_list":["post-4283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-buffer-overrun","tag-c4789"],"acf":[],"blog_post_summary":"<p>When Visual Studio 2010 ships, it will have improvements to warning C4789; allowing it to catch more cases of buffer overrun. This blog post will cover what C4789 warns about, and how to resolve the warning. What does C4789 mean? &nbsp; When compiling your source file, you may receive the warning: &ldquo;warning C4789: destination of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/289"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=4283"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/4283\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=4283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=4283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=4283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}