How to turn on Array bounds checking?

I just discovered that EasyC has no Array Bounds checking,
not even for constants.

I made a rookie mistake, and EasyC didn’t find it for me.
Array[4] {0,0,0,0} // Subscripts should be Array[0] … Array[3]

I had macro-constants STK1 = 1; … STK4=4;
and then referenced Array[STK4] with no compile error,
but the return value was some non-zero value in memory, which made my program behavior unexpected. ACK!

Is there a way to turn on Array Bounds Checking?
Many C compilers have switches to check for this type of error during development, and then not check for them in production.

Meanwhile, my solution is to change to Array[5] = {0,0,0,0,0}
and waste the [0] slot.

In C, most compilers do not automaticly have array bounds check enabled. You can use a switch to enable it but it’s not a default.

We do throw an warning if you attempt x[3] = {1,2,3,4); or x[A] = = {1,2,3,4); //#define A 3
“warning: excess elements in array initializer”

We will look into throwing an error in a future release.