For the complete documentation index, see llms.txt. This page is also available as Markdown.

Compiler errors (GPC51xx)

GPC5100 — Unknown Opcode

Unknown opcode: {name}
No push immediate opcode available in configuration (expected pushi8, pushi16, pushi32, or pushi)
No allocation opcode available in configuration (expected alloc or alloc16)

Severity: Error

The compiler needs an instruction that the selected device does not provide. This indicates a problem with the toolchain or device profile, not with your script.


GPC5102 — Data Not Constant

The constant '{name}' could not be computed at compile-time. All definitions must be possible to compute during compilation.
The enum value '{name}' could not be computed at compile-time. All enum values must be possible to compute during compilation.
Data section values must be constant expressions
The expression '{expr}' could not be computed at compile-time. All const array values must be possible to compute during compilation.

Severity: Error

A define value, enum member value, data(...) entry, or const array value contains something that cannot be evaluated at compile time — typically a reference to a variable or a function call. These contexts accept only literals and arithmetic over other compile-time constants.

int limit;
define MAX = limit + 1;   // GPC5102 — 'limit' is a runtime variable

GPC5103 — Array Size Not Constant

Severity: Error

The size expression in a variable array declaration (int arr[N];) is not a compile-time constant. Use a literal, define, or enum member.


GPC5104 — break Outside Loop

Severity: Error

Safety-net counterpart of GPC4005 for break; under normal circumstances the earlier check reports the problem first.


GPC5105 — continue Outside Loop

Severity: Error

Safety-net counterpart of GPC4005 for continue.


GPC5106 — Unsupported Literal Type

Severity: Error

A string literal ("...") appears somewhere other than the two places GPC allows it: initializing a const string declaration, or as the operand of addr(). A bare "..." used directly as a function argument, in arithmetic, in an assignment, or anywhere else in an expression triggers this error.

Functions that take text (e.g. print's string address parameter) don't accept a literal inline — they take the address of a declared const string. Declare the string first, then pass its name (or addr(name)):


GPC5108 — Unsupported Binary Operator

Severity: Error

Internal safety net for an operator the compiler cannot translate in this position; reaching it indicates a compiler bug, not a script error — report the script that triggers it.


GPC5111 — Increment/Decrement Requires Variable

Severity: Error

Safety-net counterpart of GPC4007 for ++/-- on a non-variable operand.


GPC5112 — sizeof Unresolved

Severity: Error

sizeof() was applied to an operand whose size the compiler cannot determine — e.g. a 2D-indexed access on something that is not a 2D const array, or an arbitrary expression.


GPC5113 — sizeof(keyword) Not Supported

Severity: Error

sizeof() was applied to a keyword that has no supported fixed size on the selected target. On the current Zen target, the numeric forms sizeof(int8), sizeof(uint8), sizeof(int16), sizeof(uint16), and sizeof(int32) are supported. sizeof also works on variables, variable arrays, const arrays, and const array elements.


GPC5114 — Immediate Value Out of Range

Severity: Error

A compile-time value does not fit its storage: a const array element outside its declared element type's range, or (in a 16-bit script) an immediate constant outside the 16-bit signed range.


GPC5116 — Invalid Image Data

Severity: Error

A const image entry is malformed. The format is width, height followed by exactly ceil(width * height / 8) packed pixel bytes, with dimensions bounded by the device's OLED screen size.


GPC5123 — Negative Array Size

Severity: Error

A variable array is declared with a constant negative size, e.g. int arr[-1]; or a define/enum that evaluates below zero.


GPC5125 — Inconsistent Return

Severity: Error

Within one function, some return statements carry a value and others are bare return;. A GPC function either returns a value on every return path or on none of them.


GPC5126 — addr() Requires Const Array

Severity: Error

The operand of addr() is not a const array (or const-array element access). addr() yields the data-section address of const array contents; variables and other symbols have no such address.


GPC5128 — Undefined Function

Severity: Error

A call names a function that is neither user-defined nor a built-in of the selected device. Check spelling, and check that the function exists on the target device/firmware.


GPC5129 — Undefined Combo

Severity: Error

A combo keyword (combo_run, combo_stop, ...) references a combo name that is not declared anywhere in the script.


GPC5130 — Invalid Argument Count

Severity: Error

A call passes the wrong number of arguments — user functions must be called with exactly their declared parameter count; each built-in has its own required minimum and maximum on the target device.


GPC5131 — Invalid Argument Type

Severity: Error

An argument does not meet the parameter's declared requirement. Some built-in parameters accept only a compile-time constant from a fixed list — e.g. ps4_touchpad's constant parameter only accepts one of the PS4T_* identifiers, not a variable or computed value. Others must be a plain declared variable — e.g. set_bit/clear_bit/set_bits's variable parameter, since the function reads or writes that variable directly; a constant, enum member, or arbitrary expression there triggers this error (a constant-index array element is still fine).


GPC5132 — Argument Out of Range

Severity: Error

A constant argument is outside the hard limits for the parameter — currently enforced for wait() durations in combos. (Range limits on other built-in arguments are reported as GPC5153 or GPC6010 instead.)


GPC5133 — Combo Function Context

Severity: Error

A combo keyword is used in the wrong expression/statement position: statement keywords (combo_run, combo_stop, ...) produce no value and cannot appear inside expressions or conditions; expression keywords (combo_running, combo_suspended, combo_current_step, combo_step_time_left) produce a value that must be consumed; and wait() is only meaningful inside a combo body.


GPC5134 — Function Has No Return Value

Severity: Error

A function whose body never returns a value is used in a condition, assignment, or argument. Either add return <value>; statements to the function or stop consuming its (nonexistent) result.


GPC5135 — Unused Return Value

Severity: Error

A built-in function that returns a value is called as a bare statement, discarding the result. Unlike most languages this is an error in GPC (for built-ins; user-function results may be discarded). Assign the result or use it in a condition.


GPC5136 — Function Not Allowed in Loop

Severity: Error

This built-in must not be called from inside a loop body on the target device (its side effects must run at most once per main pass). Move the call out of the loop.


GPC5137 — Function Minimum Level

Severity: Error

This built-in may only be called from a sufficiently nested context — e.g. only from inside a user-defined function rather than directly in main.


GPC5138 — Invalid Case Value

Severity: Error

A case label in a switch is not a compile-time integer constant. Use literals, defines, or enum members.


GPC5139 — Duplicate Case Value

Severity: Error

Two case labels in the same switch resolve to the same constant — remember that defines and enum members are resolved to their values first.


GPC5140 — Duplicate Label

Severity: Error

The compiler saw the same internal jump label defined twice. Internal error — not producible from script source directly; report the script that triggers it.


GPC5141 — Undefined Label

Severity: Error

The compiler saw a jump to an internal label that was never defined. Internal error — not producible from script source directly; report the script that triggers it.


GPC5142 — Internal Compiler Error

For example: Internal error: number literal token has no value, Internal error: current combo data not found, Unexpected block-level statement at top level, Failed to deserialize device configuration: {error}.

Severity: Error

An invariant inside the compiler itself was violated. This is a compiler bug, not a script bug — report the script that triggers it.


GPC5143 — Maximum Variables Exceeded

Severity: Error

The script declares more variable storage than the device provides. Every scalar variable takes one slot and every variable array takes one slot per element; combos also reserve a few internal slots. Shrink arrays or move constant tables into const arrays (which live in the data section, not variable slots).


GPC5144 — Maximum Bytecode Size Exceeded

Severity: Error

The compiled output is larger than the device's bytecode limit. Reduce script size — factor repeated code into functions, shrink data tables, and let the optimizer remove unused code.


GPC5145 — Expression Has No Effect

Severity: Error

A statement consists of an expression that neither assigns, calls, increments, nor otherwise does anything — its value is computed and thrown away. Almost always a typo, e.g. == where = was meant.


GPC5153 — Builtin Argument Out of Range (Error)

Severity: Error

A constant argument is outside the hard limit the target device sets for that built-in parameter. Same message templates as GPC6010 — whether a given built-in parameter's limit is a hard error (this code) or a recommendation (GPC6010) depends on the parameter and the target device, not on how you call it. (wait() durations in combos report GPC5132 instead.)


GPC5154 — Zero-Size Array With No Alias Target

Severity: Error

A zero-size array declaration (int arr[0];) is, by itself, an accepted GPC quirk: it occupies no storage and its name aliases whatever variable is declared immediately after it (see GPC6031). This error is the invalid form of that quirk — the zero-size array is declared with nothing following it (or nothing eligible to alias), so its implied slot sits at or past the end of the allocated variable table. Any access through it would read or write past allocated memory. Declare a real variable after it, or remove the zero-size array.

Last updated