# zig cc: emit to a.out if outpath is unspecified · gitcafe/zig

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

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

Visibility: public

Requested revision: 4521456f66122c6348ef6980ae1eecdb94f4f110

Requested commit: 4521456f66122c6348ef6980ae1eecdb94f4f110

Commit: 4521456f66122c6348ef6980ae1eecdb94f4f110

Tree: e4e8f5c133e20a448ba542def2d3d43e20d7431f

Author: Motiejus Jakštys

Committer: Andrew Kelley

## Message

```
zig cc: emit to a.out if outpath is unspecified

If `-o` is not specified for `zig cc` for linking, it should emit the
`a.out` (or equivalent) to the current directory. So then this:

    $ zig cc test.c

Should result in `./a.out`.

If directory is omitted from `Compilation.EmitLoc`, it will default to
the cache directory later in the compilation chain, which will result
in `a.out` missing in the current directory.

If we specify the directory to `Compilation.EmitLoc`, it will be
handled, allegedly, correctly.

Fixes #12858

```

## Parents

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

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