Bug 78036

Summary: -MM suppresses error detection
Product: gcc Reporter: Petr Skocik <pskocik>
Component: driverAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: unknown   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Petr Skocik 2016-10-19 09:49:15 UTC
Example:

touch in.h
gcc -x c -include in.h - -MD -MF /dev/stdout <<<'int main(){x; return 42;}

fails as it should.

Changing -MD to -MM causes the failure to go undetected (no stderr output, no nonzero exit status), making it look as if the compilation succeeded.

(Notes: Changing -MF /dev/stdout to -MF regular_file makes no difference.
Clang has this behavior too)
Comment 1 Andreas Schwab 2016-10-19 09:54:00 UTC
-MM implies -E, -MD doesn't.