# Make align expr on fns a compile error in Wasm · gitcafe/zig

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

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

Visibility: public

Requested revision: 015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c

Requested commit: 015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c

Commit: 015c899297c9fdc8ef9d0d22af29a7a0d0bdbc5c

Tree: dc7f91bfdd2d218628a99b9c4484533b4b890246

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
Make align expr on fns a compile error in Wasm

In Wasm, specifying alignment of function pointers makes little sense
since function pointers are in fact indices to a Wasm table, therefore
any alignment check on those is invalid. This can cause unexpected
behaviour when checking expected alignment with `@ptrToInt(fn_ptr)`
or similar. This commit proposes to make `align` expressions a
compile error when compiled to Wasm architecture.

Some references:
[1] [Mozilla: WebAssembly Tables](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#WebAssembly_tables)
[2] [Sunfishcode's Wasm Ref Manual](https://github.com/sunfishcode/wasm-reference-manual/blob/master/WebAssembly.md#indirect-call)

```

## Parents

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

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