title: How to disable a particular unknown #pragma warning (GCC and/or Clang)
body: <p>I know how to disable <em>all</em> unknown #pragma warnings. The answer was given, for example, in <em><a href="https://stackoverflow.com/questions/132667/how-to-disable-pragma-warnings">How can I disable #pragma warnings?</a></em>.</p>
  <p>Is there a way to disable an 'unknown pragma' warning for one particular pragma? For example, if I disable warning for <code>#pragma ugubugu</code> the following code:</p>
  <pre><code>#pragma ugubugu
  #pragma untiunti
  
  int main() {return 0;}
  </code></pre>
  <p>when compiled with either:</p>
  <pre class="lang-none prettyprint-override"><code>g++ pragma.cpp -Wall
  clang++ pragma.cpp -Wall
  </code></pre>
  <p>should produce a single warning:</p>
  <pre class="lang-none prettyprint-override"><code>warning: ignoring #pragma untiunti
  </code></pre>
  <p>Maybe, for example, is there a simple way to register a custom pragma which would do nothing?</p>
  <p>It would be great to know if there is such an option is Visual Studio too, but that is less important.</p>
  <hr />
  <p><em>&quot;But why ultimately is he playing with custom pragmas?&quot;</em></p>
  <p>My source code is parsed by two compilers. In one of those, there is a special <code>#pragma</code> that is unknown to the other. Of course, I could probably put <code>#ifdef COMPILER_IDENTIFICATION_MACRO ... #endif</code> around every instance of the <code>#pragma</code>, but that would be cumbersome.</p>