Bug 78036 - -MM suppresses error detection
Summary: -MM suppresses error detection
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-19 09:49 UTC by Petr Skocik
Modified: 2016-10-20 02:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.