bytecodealliance / bytecodealliance/wit-bindgen

C: generating no-op functions

Open
#1,438 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
286
Avg merge
6h 32m
Merged PRs (30d)
19

Description

This might not be a huge issue, but probably worth pointing out anyway.

Given the following wit:
```wit
package my-namespace:my-package;

interface my-interface {
type my-type = u32;
record my-record {
my-field: option,
}
}

world my-world {
import my-interface;
}
```

With command:
```shell
wit-bindgen c wit --world my-world
```

Generates function:
```c
void my_world_option_my_type_free(my_world_option_my_type_t *ptr) {
if (ptr->is_some) {
}
}
```

The if block seems extra if nothing is going to happen inside.

If I remove the option around `my-type` the free function is not being generated at all.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.