# zig cc: fix handling of \-MM flag · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/041212a41cfaf029dc3eb9740467b721c76f406c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 041212a41cfaf029dc3eb9740467b721c76f406c

Requested commit: 041212a41cfaf029dc3eb9740467b721c76f406c

Commit: 041212a41cfaf029dc3eb9740467b721c76f406c

Tree: 2eac3522d4a0238ddd5d74a142d8f0193e2aecf7

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
zig cc: fix handling of -MM flag

Clang docs say:
> Like -MMD, but also implies -E and writes to stdout by default.

Previously, Zig handled this option by forwarding it directly to Clang,
and disabling depfiles. However this did not adhere to Clang's documented
behavior of these flags.

Now, in addition to being forwarded directly to Clang, `-MM` also
sets c_out_mode = .preprocessor, just like `-E`.

Another issue I noticed is that Zig did not recognize the aliases for
-MG, -MM, or -MMD. The aliases are now recognized.

```

## Parents

- [98b24aa47f98d9c70d1e152228ac89dd41e0f637](https://git.cafe/gitcafe/zig/commit/98b24aa47f98d9c70d1e152228ac89dd41e0f637?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/041212a41cfaf029dc3eb9740467b721c76f406c?format=markdown)
