pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
301 stars 71 forks source link

`initialization data exceeds declared size` when using progressive initialization with an array size 1 #727

Open Vince0789 opened 11 months ago

Vince0789 commented 11 months ago

Issue description:

This sounds stupid, because why would anyone create an array size 1? But do consider the example below that keeps things open for extension without requiring significant changes in code.

Minimal complete verifiable example (MCVE):

enum E_COMPETENCE {
    E_COMPETENCE_PICKPOCKET,
}

static
    Float:gs_CompetencePointBase[E_COMPETENCE] = {5.0, ...};

Adding another entry to the enum or removing the progressive initializer resolves the problem.

Workspace Information: