wit-bindgen
wit-bindgen copied to clipboard
C: generating no-op functions
This might not be a huge issue, but probably worth pointing out anyway.
Given the following wit:
package my-namespace:my-package;
interface my-interface {
type my-type = u32;
record my-record {
my-field: option<my-type>,
}
}
world my-world {
import my-interface;
}
With command:
wit-bindgen c wit --world my-world
Generates function:
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.