# 0120: Expected calling convention type

Compiler expected a valid name of a [foreign function](https://docs.sannybuilder.com/language/functions#foreign-functions)'s calling convention but found something else.

A foreign function (a declaration-only function pointing to a memory address in the game) must define the calling convention (can be either `cdecl`, `stdcall`, or `thiscall`) for the compiler to correctly pick the opcode when this function is called.

```pascal
function CStats__GetStatType<0x558E30>(statId: int): int // error: expected calling convention type (cdecl, stdcall, or thiscall), found 0x558E30.
```

#### Possible solutions:

* check your function definition and provide a correct name of the calling convention after `<:`

```pascal
function CStats__GetStatType<cdecl, 0x558E30>(statId: int): int // OK
```

Refer to [foreign function](https://docs.sannybuilder.com/language/functions#foreign-functions) documentation to find list of available conventions and difference between them
