https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108101
Bug ID: 108101 Summary: "#pragma once" causes other files not be included Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: terra at gnome dot org Target Milestone: --- # (echo '#pragma once'; echo 'Killroy was here') > a.h # (echo '#pragma once'; echo 'Killroy was here') > b.h # (echo '#include "a.h"'; echo '#include "b.h"') > c.c # gcc -E c.c | grep Killroy 1 # clang -E c.c | grep Killroy 2 According to gcc, Killroy was only there once. Clang is keeping better track and spots him there twice. This seems to be version independent: tried 7.5.0 and 12.1.0