# Function calling conventions

**URL:** <https://ziggit.dev/t/function-calling-conventions/15948>\
**Category:** Explain\
**Tags:** language, c\
**Created:** [June 6, 2026, 1:50am UTC](https://ziggit.dev/t/function-calling-conventions/15948 "2026-06-06T01:50:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![alanza](https://ziggit.dev/user_avatar/ziggit.dev/alanza/32/6006_2.png) [@alanza](https://ziggit.dev/u/alanza)\
**Post date:** [June 6, 2026, 2:16am UTC](https://ziggit.dev/t/function-calling-conventions/15948/2 "2026-06-06T02:16:50Z")

</div>

> [@Kaeru](#):
>
> How many calling conventions does Zig have? What is function’s prologue and epilogue? Why does wasm not want either? Do different calling conventions affect a program’s behaviour or is it just for FFI?

They’re described in `std.builtin.CallingConvention`.

A function’s prologue and epilogue are bits of assembly that do things like move arguments to/from registers (or tell you where on the stack they are), set up and/or move the instruction pointer, the return address, and so on.

Since, for example “inline” is also a calling convention, they _do_ affect your program’s behavior, but the differences in effects are usually not (and probably should not be) on the level of changing your program’s semantics. The reason they’re relevant for FFI is that Zig and the other programming language have to agree with how to call a function in order for the handshake in and out of your code to work.

You might like reading this blog post, even if a bunch of it is just flavor at the moment 🙂 [The Fil-C Optimized Calling Convention](https://ziggit.dev/t/the-fil-c-optimized-calling-convention/15594)

---

_[View the full topic](https://ziggit.dev/t/function-calling-conventions/15948)._
