title: Determine if all needed header files are included in another header file
body: <p>Suppose I have a header file which should be including another header file but doesn't (for whatever reason). For example:</p>
  
  <p><strong>myHeader.h</strong></p>
  
  <pre><code>#ifndef MYHEADER_H
  #define MYHEADER_H
  
  struct i
  {
    uint32_t field; // Forgot to include &lt;cstdint&gt;
  };
  
  #endif
  </code></pre>
  
  <p>This mistake can be easily hidden in the .c/.cpp files. For instance like this:</p>
  
  <p><strong>someFile.cpp</strong></p>
  
  <pre><code>#include "myOtherHeader.h" // &lt;cstdint&gt; gets included through this file
  #include "myHeader.h"
  
  struct i someStruct;
  </code></pre>
  
  <p>someFile.cpp will compile just fine and hide the fact that I missed including <code>cstdint</code> in myHeader.h. This isn't a problem here, but suppose when I want to use myHeader.h in some other .cpp file, that could cause a problem.</p>
  
  <p>Is there a simple way to detect this omission of the header file? There are unpleasant ways, like manually looking over the file (but that is tedious and error prone), or creating a dummy .cpp file and including just the header file in question (but that isn't scalable to a large number of header files). Is there some static analysis tool or method that would check this for me?</p>