https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79465
Bug ID: 79465 Summary: infinite #include cycle is not detected Product: gcc Version: 6.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: valsiterb at gmail dot com Target Milestone: --- I was working on a 20 years old codebase and in order to increase compilation speed, I've converted all header guards to #ifdef ... #error to go on and change things around, but there was a cycle somewhere in the headers (a.h includes b.h but b.h also includes a.h) cpp does not detect this case and goes on unil it gets killed. I don't know if cycle detection is even supposed to part of the preprocessor, but I expected that #error would make it stop there. I know that there is -Wfatal-errors directive. Shouldn't #error be be fatal or am I missing something?