https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57951
--- Comment #2 from Frank Heckenbach <f.heckenb...@fh-soft.de> --- Another bug that may be related to this one (and certainly depends on it), originally reported as Debian bug #613551: Tested with gcc-4.1 (apparently the last version that did allow "-MD -MG"): When using "-MG", gcc doesn't give an error message, neither exits with nonzero status when included files don't exist, even if not only preprocessing ("-M"), but also when actually compiling ("-MD"). This can, in extreme cases, lead to miscompilation (if the included file e.g. redefines existing macros), usually only to surprising errors (the results of missing declarations from the include file, without a leading hint to its absence). % cat foo.c #include "non-existing-file" % gcc -MD -MG -c foo.c % echo $? 0