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?
Something like:
gcc -H=file.h -c file.cc
I know I can use SHELL tricks to filter out this "-H"-output, but I would like to avoid that.
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.
While GCC's developer-option "-save-temps" saves the entire preprocessor-output to a file, it does not save the "-H"-output with it.
any_command 2>file_to_redirect_stderr_to