Skip to content

Support variadic native function calls #1031

Closed

Description

@frostney

Summary

Add an explicit signature and call-frame mechanism for invoking C variadic functions safely.

Why

Raylib 6.0 exposes two variadic public functions, TraceLog(int, const char *, ...) and TextFormat(const char *, ...). Both remain outside the generated bindings because the current FFI can describe only a fixed argument array. See the merged skip report.

Current behavior

There is no valid descriptor for the variadic tail:

const traceLog = raylib.bind("TraceLog", {
  args: ["i32", "utf8string"],
  returns: "void",
});
traceLog(3, "%s", "hello");

The extra values are not part of the compiled signature and are not marshalled, so this cannot safely call the C function.

Current-source evidence on main (34cc32f):

The fresh-main FFI suite passes in interpreted and bytecode modes (92 tests, 337 assertions); it contains no variadic signature surface or fixture.

Expected behavior

Provide an explicit way to declare a fixed prefix plus variadic argument types at each call, applying the platform ABI's default argument promotions and classification rules. Calls that omit required variadic type information should fail before entering native code.

Scope notes

Activity

  1. added
    new featureNew feature or request
    runtimeTGocciaRuntime: optional host extensions (console, fetch, JSON5, FFI, test assertions, etc.)
    on Jul 24, 2026
  2. added this to the 0.11.0 milestone on Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or requestruntimeTGocciaRuntime: optional host extensions (console, fetch, JSON5, FFI, test assertions, etc.)

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions