title: GCC optional preprocessor output and compilation in one pass
body: <p>GCC's preprocessor-option "-H" prints the name of each header file used to STDERR. Is it possible to forward this output to a file, instead of letting it print to STDERR, and let GCC continue with the compilation in one step?</p>
  
  <p>Something like:</p>
  
  <pre><code>gcc -H=file.h -c file.cc
  </code></pre>
  
  <p>I know I can use SHELL tricks to filter out this "-H"-output, but I would like to avoid that.</p>
  
  <p>I just want to write the "-H"-output to a file instead of STDERR. I don't care if this output for some reason had to be mixed/interleaved with some other output, as long as the "-H"-output did not pollute STDERR and normal compilation/linking warnings/errors were still being printed to STDERR.</p>
  
  <p>While GCC's developer-option "-save-temps" saves the entire preprocessor-output to a file, it does not save the "-H"-output with it.</p>