> For the complete documentation index, see [llms.txt](https://guide.cronuszen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cronuszen.com/gpcscripting/gpc-script-guide/troubleshooting/compiler-diagnostic-catalog/extended-compiler-warnings-gpc60xx.md).

# Extended compiler warnings (GPC60xx)

### GPC6010 — Argument Out of Recommended Range

```
Argument {i} of '{name}' is {value}, minimum is {min}
Argument {i} of '{name}' is {value}, maximum is {max}
Argument {i} of '{name}' has value {value} which is not in the allowed set
```

**Severity:** Warning

A constant argument falls outside the recommended range (or allowed value set) for that built-in parameter on the target device. The call still compiles; behavior at runtime may be clamped or undefined. (Hard limits report the error GPC5153 instead.)

***

### GPC6011 — Deprecated Function

```
Function '{name}' is deprecated
```

Often extended with the reason, e.g. `Function '{name}' is deprecated — Use '{replacement}' instead.`

**Severity:** Warning (tagged *deprecated*)

The called built-in is deprecated on the target device. It still works, but a better alternative exists — when the message names a replacement, switch to it. For example, `printf` on the Cronus Zen 32 reports `Function 'printf' is deprecated — Use 'print' instead.` A few deprecated functions report a more specific code instead of this generic one — see GPC9000 for the data-section reader functions.

***

### GPC6012 — Function in Loop

```
'{name}': {message}
```

Where `{message}` explains the specific concern for that function.

**Severity:** Warning

A built-in that should not run repeatedly is called inside a loop. What the risk is depends on the function — the message spells it out. The classic case is `set_pvar`, which writes persistent storage that wears out with repeated writes; on devices where that matters it reports the more specific GPC9001 instead.

***

### GPC6014 — Assignment in Condition

```
Assignment in condition — did you mean '==' instead of '='?
```

**Severity:** Warning

An assignment expression is used directly as a condition. Legal, but overwhelmingly a typo for `==`. This only fires for a plain `=`; compound assignment operators (`+=`, `-=`, ...) used in a condition are not flagged.

```c
if (mode = 2) { ... }    // GPC6014 — assigns 2, always true
if (mode == 2) { ... }   // comparison
```

***

### GPC6015 — Division Results in Zero

```
Division with constant operands results in 0
```

**Severity:** Warning

A division of compile-time constants folds to 0 (integer division truncates, e.g. `1 / 2`). The expression is replaced by the constant 0 — if you expected a fraction, rescale your math.

***

### GPC6016 — Modulus Results in Zero

```
Modulus with constant operands results in 0
```

**Severity:** Warning

A modulus of compile-time constants folds to 0. Usually indicates the left operand is a multiple of the right, or a misunderstanding of the operands.

***

### GPC6017 — Shift Out of Bounds

```
Shift amount {n} exceeds maximum of {max} for {bits}-bit target
```

**Severity:** Warning

A constant shift amount is `>=` the width of the script's integer type (16 or 32). The result is not what the literal math suggests.

***

### GPC6018 — Switch Case Fallthrough

```
Switch case falls through to the next case without break or return
```

**Severity:** Warning

A non-empty `case` block does not end in `break` or `return`, so execution continues into the next case. Add `break;` (or a comment-free intentional restructure) — GPC has no fallthrough annotation.

***

### GPC6019 — Unused Variable

```
Variable '{name}' is declared but never directly used
```

**Severity:** Warning

A variable is declared but no statement reads or writes it. Remove it to free a variable slot.

***

### GPC6020 — Assigned But Never Read

```
Variable '{name}' is directly assigned but never directly read
```

**Severity:** Warning

The variable is written (or initialized) but its value is never read back. The stores are wasted work; either use the value or delete the variable.

***

### GPC6021 — Read But Never Assigned

```
Variable '{name}' is directly read but never directly assigned (always has default value 0)
```

**Severity:** Warning

***

The variable is read but never written, so every read yields the default value 0. Usually a forgotten initialization or a name mix-up.

### GPC6022 — Unused Const Array

```
Const array '{name}' is declared but never used
```

**Severity:** Warning

A const array is never referenced. Its data still occupies space in the data section — delete it.

***

### GPC6023 — Unused Function Argument

```
Function argument '{name}' is never used
```

**Severity:** Warning

A parameter of a user-defined function is never referenced in the function body.

***

### GPC6024 — combo\_restart in init

```
combo_restart in init section is equivalent to combo_run
```

**Severity:** Warning

`combo_restart` inside `init` has nothing to restart (no combo state exists yet), so the compiler emits the same code as `combo_run`. Write `combo_run` for clarity.

***

### GPC6026 — Empty Switch

```
Switch statement has no cases and has no effect
Switch statement has no cases; the 'default' block always runs
```

**Severity:** Warning

A `switch` contains no `case` labels. Without a `default` it does nothing; with only a `default` the switch is pointless — the block runs unconditionally.

***

### GPC6027 — OLED Glyph Blank in Large Font

```
Argument {i} of '{function}': string '{name}' contains special glyphs with no bitmap in the LARGE OLED font: {bytes}
```

**Severity:** Warning

A string printed with `OLED_FONT_LARGE` contains special glyph bytes (`\x7F`–`\x88`, the controller-symbol glyphs). The 16x26 device font has no bitmaps for these, so they render blank. Use the small or medium font for symbol glyphs.

***

### GPC6028 — Unsupported OLED String Byte

```
Argument {i} of '{function}': string '{name}' contains bytes with no OLED font glyph (supported range \x20-\x88): {bytes}
```

**Severity:** Warning

A string passed to an OLED print function contains bytes below `\x20` or above `\x88`, which no OLED font can render. Check escape sequences and non-ASCII characters in the string.

***

### GPC6029 — Postfix Increment in Return

```
Postfix '{++|--}' in a return statement yields the value before the {increment|decrement}. Use the prefix form if the updated value is intended
```

**Severity:** Warning

`return x++;` returns the value *before* the increment (standard C semantics), but the original Zen Studio compiler returned the value *after* it — so this construct behaves differently between compilers. `return ++x;` behaves identically in both; use the prefix form to make the intent unambiguous.

***

### GPC6030 — Array Index Call Evaluated Twice

```
Function '{name}' is called twice: the array index is evaluated once for the read and once for the write
Function '{name}' is called twice: the index is re-evaluated when the assignment result is used
```

**Severity:** Warning

A dynamic array index (one that is not a compile-time constant) contains a function call, and the compiler must re-evaluate that index expression more than once — so the call, and any side effect it has, runs more than once per statement. The first message fires for compound assignment on a dynamic index (`arr[f()] += 1;`: one evaluation to read the current value, one to write the new one) — this happens unconditionally, even in bare-statement context. The second fires when a plain assignment's *result* is also consumed, e.g. used in a condition or as a value (`if (arr[f()] = 5) { ... }`) — a third, trailing re-read of the index. Give the index a fixed value first (`i = f(); arr[i] += 1;`) to avoid the repeat calls.

***

### GPC6031 — Zero-Size Array

```
Zero-size array '{name}' occupies no storage and aliases the next declared variable
```

**Severity:** Warning

A zero-size array declaration (`int arr[0];`). This is an accepted quirky feature, not an error: the array occupies no storage and its name aliases the next declared variable's slot (some community scripts deliberately exploit this to get two names for one variable). Warned so accidental zero-size declarations are debuggable — the aliasing behavior itself is intentional and documented, not a bug. See GPC5154 for the invalid form, where there is no following variable to alias.

```c
int arr[0];   // GPC6031 — aliases 'next'
int next;
```

***

### GPC6032 — 16-bit Data Value

```
Data value requires 2 bytes; subsequent data section indexes will be offset by 1
```

**Severity:** Warning

A value in the `data(...)` section does not fit in one byte and is stored as 2 bytes. Data-section access functions address *bytes*, so every index after this value shifts by 1. Keep data values in `-128..255` if you rely on 1-value-per-index addressing.

***

### GPC6033 — 24-bit Data Value

```
Data value requires 3 bytes; subsequent data section indexes will be offset by 2
```

**Severity:** Warning

A value in the `data(...)` section does not fit in two bytes and is stored as 3 bytes (values outside `-32768..65535` but within `-8388608..16777215`, on devices that support 24-bit data values). Data-section access functions address *bytes*, so every index after this value shifts by 2. Keep data values in `-128..255` if you rely on 1-value-per-index addressing.

***

### GPC6034 — 32-bit Data Value

```
Data value requires 4 bytes; subsequent data section indexes will be offset by 3
```

**Severity:** Warning

A value in the `data(...)` section is stored as 4 bytes — it falls outside `-8388608..16777215`, or outside `-32768..65535` on devices without 24-bit data support. Data-section access functions address *bytes*, so every index after this value shifts by 3. Keep data values in `-128..255` if you rely on 1-value-per-index addressing.

***

### GPC6035 — Potential Stack Overflow

```
Potential stack overflow at instruction '{opcode}' (line {line}, column {column}). Variables: {count}, Stack: {depth}, Max: {max}
```

A variant naming the called function exists for call instructions.

**Severity:** Warning

The compiler determined that at some point the script could use more working stack than the device provides — variables, in-flight expression values, and function calls all count against the same fixed limit. Deeply nested expressions or deep call chains are the usual cause. A legitimately-compilable script can trigger this; it warns of a real on-device crash risk, not a compiler bug. Flatten the expression or shorten the call chain.

***

### GPC6036 — Recursive Function Call

```
Recursive function call detected: {name}. Cannot statically determine max stack usage.
```

**Severity:** Warning

A user function calls itself (directly or through a cycle), so the compiler cannot determine how much stack it may use — the GPC6035 overflow check cannot cover that chain. Recursion on a device with a small fixed stack is risky; prefer iteration.

***

### GPC6037 — Empty or Missing `main`

```
No main block, or the main block is empty
```

**Severity:** Warning

The script has no `main` section, or one that contains no statements. A GPC script's real-time logic lives in `main`; without it the compiled script does nothing per report cycle.

This also fires on scripts that deliberately do all their work in `init` — the warning is expected there, not a mistake.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/troubleshooting/compiler-diagnostic-catalog/extended-compiler-warnings-gpc60xx.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
