Docs menu

E116: An extern function can't have a body

What compiler error E116 means, and how to fix it.

extern fn doesn’t define a function, it announces one that already exists somewhere else (usually in C). The code is not in your file, so there is nothing to write in { ... }:

Example
extern fn malloc(size: int): ptr {       // no body allowed    return null;}

Declare it with a semicolon instead:

Example
extern fn malloc(size: int): ptr;

If you wanted to write the function yourself in Turf, drop the extern:

Example
fn my_alloc(size: int): ptr { ... }

Run turf --explain E116 in a terminal to read this again.

Last updated: Oct 15, 2026Edit this page on GitHub

Esc

Type to search.