# InternPool,Sema,type,llvm: alignment fixes · gitcafe/zig

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

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

Visibility: public

Requested revision: 1b672e41c528b0aa225cbe07c61203d04b2d9034

Requested commit: 1b672e41c528b0aa225cbe07c61203d04b2d9034

Commit: 1b672e41c528b0aa225cbe07c61203d04b2d9034

Tree: 080cac4fbde495c9b216fac1cd67e84799740059

Author: mlugg

Committer: Andrew Kelley

## Message

```
InternPool,Sema,type,llvm: alignment fixes

This changeset fixes the handling of alignment in several places. The
new rules are:
* `@alignOf(T)` where `T` is a runtime zero-bit type is at least 1,
  maybe greater.
* Zero-bit fields in `extern` structs *do* force alignment, potentially
  offsetting following fields.
* Zero-bit fields *do* have addresses within structs which can be
  observed and are consistent with `@offsetOf`.

These are not necessarily all implemented correctly yet (see disabled
test), but this commit fixes all regressions compared to master, and
makes one new test pass.

```

## Parents

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

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