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.