what is the usage of `(void)d`
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6145548/what-is-the-purpose-of-the-statement-voidc">What is the purpose of the statement &ldquo;(void)c;&rdquo;?</a>  </p>
</blockquote>



<pre><code>class ArgString : public Arg::Base
{
public:
    ...
    bool CanConvertToInt() const
    {
        const char *cstr = mValue.c_str();
        char *result = 0;
        long d = strtol(cstr, &amp;result, 10);
        (void) d; // what is the usage of this line?
        return result != cstr;
    }

private:
    std::string mValue;
};
</code></pre>

<p>Can someone tell me what the purpose of the following line is?</p>

<pre><code>(void) d;
</code></pre>

<p>Thank you</p>

<p>// Update //</p>

<p>As some people pointed out, the purpose of the line is to suppress the compilation warning. To me, that is very strange. Because this is much severe warning</p>

<pre><code>    warning 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.
</code></pre>

<p>Why we ignore this big warning and ONLY address the smaller one.</p>
