Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

F.4 Extern Calls

Extern calls on the C backend follow udewy's usual 64-bit integer/pointer model:

  • arguments are passed as raw 64-bit values
  • return values are observed as raw 64-bit values
  • pointers are passed by their bit pattern

This is a good match for ordinary integer/pointer C APIs such as allocators, memory functions, or platform handles. It is not intended to automatically model richer C type information, variadic formatting conventions, or mixed integer/floating-point ABI details.

Indirect function calls also pass through the same integer/pointer representation. As with the native assembly backends, this assumes a conventional hosted platform ABI where function pointers can be used in this manner.

For known externs from udewy/third_party/c/, the C backend can emit small typed C wrappers. These avoid conflicting libc declarations and keep user code on the normal udewy integer/pointer calling convention.