# translate-c: Emit @ptrCast \+ @alignPtr sequence · gitcafe/zig

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

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

Visibility: public

Requested revision: 77383f968dde1e0d5d98865db8f560691d5f2afe

Requested commit: 77383f968dde1e0d5d98865db8f560691d5f2afe

Commit: 77383f968dde1e0d5d98865db8f560691d5f2afe

Tree: a89e9016107532754a28a70b26625156a5d6cbc6

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
translate-c: Emit @ptrCast + @alignPtr sequence

Avoid producing Zig code that doesn't compile due to mismatched
alignments between pointers.

Always emit a @alignOf instead of hardcoding the alignment value
returned by LLVM for portability sake of the generated code.

```

## Parents

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

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