> 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/high-value-compiler-errors.md).

# High-value compiler errors

### `GPC4001` — naming conflict

Variables, definitions, enum members, and const-data names share the data-symbol namespace:

```cpp
const uint8 strength[] = { 10, 20 };
int strength; // conflict
```

Function names, combo names, and function parameters use separate namespaces/scopes, although keywords and built-in names are still reserved.

Rename one symbol. Also avoid built-in function/constant names.

***

### `GPC4002` — undefined identifier

Check spelling, case, platform prefix, missing definition, and whether the name belongs to an internal/deprecated surface intentionally excluded from the guide.

***

### `GPC4003` — scoped variable unsupported

```cpp
main {
    int local_value; // invalid
}
```

Move runtime declarations to top level. Only function parameters are local.

***

### `GPC4018` — invalid const array structure

Every 2D row needs equal length:

```cpp
const uint8 BAD[][] = {
    { 1, 2, 3 },
    { 4, 5 }
};
```

***

### `GPC4020` / `GPC4021` — const index out of range

Indexes begin at zero. For size `N`, valid indexes are `0..N-1`.

***

### `GPC4022` / `GPC4023` — variable slot index under/overflow

Correct the runtime-array index or size/alias design. Validate dynamic indexes before access.

***

### `GPC4031` — missing second index

A 2D const array normally needs `[row][column]`, except valid address-style records.

***

### `GPC5102` — data not constant

Definitions, enum values, `data(...)`, const values, and array sizes cannot depend on runtime variables/functions.

***

### `GPC5106` — unsupported literal type

Declare strings in const data; do not pass a bare string where an integer/address expression is required.

***

### `GPC5125` — inconsistent return

Do not mix `return;` and `return value;` in the same function.

***

### `GPC5126` — invalid `addr`

Pass a const array/string/image/ADT item, not a runtime variable or arbitrary expression.

***

### `GPC5130..GPC5132` — built-in argument failure

Check argument count, required constant/variable form, exact accepted constant family, and numeric range against the function reference.

***

### `GPC5135` — unused required return

Consume the result:

```cpp
int value;
main { value = get_ival(PS5_RX); }
```

***

### `GPC5143` — variable limit exceeded

Live limit: 1,020 slots. Reduce runtime arrays, move immutable data to const arrays, and remove obsolete state.

***

### `GPC5144` — bytecode limit exceeded

Live maximum: 65,519 bytes. Measure before optimizing.

***

### `GPC5153` — argument outside hard range

Clamp/correct the source calculation. A runtime expression that might be out of range still needs explicit protection even when the compiler cannot prove it.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guide.cronuszen.com/gpcscripting/gpc-script-guide/troubleshooting/high-value-compiler-errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
