# link: add an explicit error set for flush\(\) and flushModule\(\) · gitcafe/zig

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

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

Visibility: public

Requested revision: b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb

Requested commit: b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb

Commit: b3cd38ea4a7520fabbb05d3d2e74351c7c8effdb

Tree: 51a821b640352c1967490e96165e2d5abbd94c2b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
link: add an explicit error set for flush() and flushModule()

This makes it easier to understand how control flow should happen in
various cases; already just by doing this it is revealed that
UndefinedSymbol and UndefinedSymbolReference should be merged, and that
MissingMainEntrypoint should be removed in favor of the ErrorFlags
mechanism thath we already have for missing the main entrypoint.

The main motivation for this change, however, is preventing a compile
error when there is conditional compilation inside linker
implementations, causing the flush() error set to depend on compilation
options. With this change, the error set is fixed, and, notably, the
`-Donly-c` flag no longer has compilation errors due to this error set.

```

## Parents

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

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