title: Visual Studio equivelent of gcc __attribute__((unused)) in c++11 (or lower)?
body: <p>I am trying to write a macro to use suppress unused variable warnings when the user wants them (e.g. in derived classes when you have not implemented the whole class yet). I know that I can remove the variable name... but to make it clear I would prefer a macro).</p>
  
  <p>So far I have this:</p>
  
  <pre><code>#ifdef WIN32
      #define UNUSED(x) x
  #else
      #define x __attribute__((unused))
  #endif
  </code></pre>
  
  <p>Used like:</p>
  
  <p><code>void test_fn(int UNUSED(test_var)) {...}</code></p>
  
  <p>I saw this post: <a href="https://stackoverflow.com/questions/3820985/suppressing-is-never-used-and-is-never-assigned-to-warnings-in-c-sharp">suppressing-is-never-used-and-is-never-assigned-to-warnings-in-c-sharp</a>, but it gave me a result that I can't really use (multiline #pragmas).</p>
  
  <p>So my question is, is there a MSVS equivalent of the <code>__attribute__((unused))</code>? - i.e. on the same line?</p>
  
  <p><strong>Note:</strong> this question does not answer how to do what I am asking: <a href="https://stackoverflow.com/questions/1486904/how-do-i-best-silence-a-warning-about-unused-variables">how-do-i-best-silence-a-warning-about-unused-variables</a> since it does not cover how to use it within the function prototype in a way that works with both MSVS and gcc.</p>