https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85290
--- Comment #3 from Thorsten Otto <ad...@tho-otto.de> --- When compiling the attached source file, which includes a header file marked as system header (same happens when include some real file from a system header path), specifying -Wdeclaration-after-statement, no diagnostic is printed. The reason is that the macro expansion gets in the way, resulting in a preprocessed source of (roughly) # 4 "bla.c" int test(void) { test(); # 8 "bla.c" 3 pid_t # 8 "bla.c" pid = 0; test(); return pid; } essentialy marking the remaining translation unit as system header.