Skip to content

Confusing syntax in API documentation #326

@osa1

Description

@osa1

Looking at https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md

For example, the function environ_sizes_get is shown as environ_sizes_get() -> (errno, size, size). This looks like it's returning three values, but if I compile a simple program to WASI this is the type of the function:

  (type (;3;) (func (param i32 i32) (result i32)))
  ...
  (import "wasi_snapshot_preview1" "environ_sizes_get" (func $__wasi_environ_sizes_get (type 3)))

So it's actually taking two args and returning one value.

I have no idea what the args are, I'm guessing they're memory locations to return values, first one is for errno, second one is for the first size, but I'm not sure. It'd be good to describe the syntax in the API docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions