Stream: git-wasmtime

Topic: wasmtime / Issue #2521 C-API: wasmtime_error_t type does ...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:31):

Dakror opened Issue #2521:

Using release v0.21.0 on x64 Linux, i can't use the error-related functionality since the wasmtime_error_t struct does not seem to be present in the C API.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:31):

Dakror labeled Issue #2521:

Using release v0.21.0 on x64 Linux, i can't use the error-related functionality since the wasmtime_error_t struct does not seem to be present in the C API.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:35):

bjorn3 commented on Issue #2521:

Are you using wasm.h instead of wasmtime.h? wasmtime_error_t is defined in wasmtime.h: https://github.com/bytecodealliance/wasmtime/blob/0b6b3d0b7a3740c96df382c746060b4eed8068fc/crates/c-api/include/wasmtime.h#L43

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:39):

Dakror commented on Issue #2521:

No i am not. Exploring the Macro definition you can see its defined in terms of itself, which can't be right:
![image](https://user-images.githubusercontent.com/2452821/102535042-ecb60500-40a7-11eb-9376-f91cdbb30b44.png)

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:40):

Dakror edited a comment on Issue #2521:

No i am not. Exploring the Macro definition you can see its defined in terms of itself without any contents, which can't be right:
![image](https://user-images.githubusercontent.com/2452821/102535042-ecb60500-40a7-11eb-9376-f91cdbb30b44.png)

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:52):

bjorn3 commented on Issue #2521:

typedef struct wasmtime_error_t wasmtime_error_t means that the type wasmtime_error_t is defined as the partial type struct wasmtime_error_t. A partial type is a type whose actual content is not yet defined. This is often used as forward reference, but in this case it is used as opaque type to not give the C code direct access to it's contents.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:53):

bjorn3 edited a comment on Issue #2521:

typedef struct wasmtime_error_t wasmtime_error_t means that the type wasmtime_error_t is defined as the partial type struct wasmtime_error_t. A partial type is a type whose actual content is not yet defined. This is often used as forward reference, but in this case it is used as opaque type to not give the C code direct access to it's contents. Typedefing something to a struct with the same name is often used to avoid explicitly having to write out the struct prefix.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:54):

Dakror commented on Issue #2521:

I see, thanks for the explanation. But the issue still remains that the information for the type is missing at link time.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 19:57):

bjorn3 commented on Issue #2521:

Types don't exist at link time, only functions and global variables. What is the link error?

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 20:02):

Dakror commented on Issue #2521:

I have seem to have misunderstood that part of the api and thought the wasmtime_error_message method was usable to just retrieve the last error during compilation which its not. I got things working now using the method properly. Thanks for your support

view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2020 at 20:02):

Dakror closed Issue #2521:

Using release v0.21.0 on x64 Linux, i can't use the error-related functionality since the wasmtime_error_t struct does not seem to be present in the C API.


Last updated: Dec 23 2024 at 12:05 UTC