[Bug preprocessor/97537] gcc -H Option Issue, incomplete dependency tree listing
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 23 09:02:09 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97537
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Oh sorry, I misread your example. The second #include "header3.h" is indeed
reached. The header is skipped due to the optimization described at
https://gcc.gnu.org/onlinedocs/cpp/Once-Only-Headers.html so the second include
is skipped and the file doesn't get reopened. I suppose that's the cause:
because the file is skipped, it isn't considered "used" again.
So I think I agree with your bug report, the output should not be affected by
the optimization, and header3.h should be considered "used" again, even if it
isn't actually opened again.
More information about the Gcc-bugs
mailing list