Firstly, according to the C standard, is the C array index variable interpreted as a signed or unsigned integer?
Secondly, what does Keil do?
The closest I can find in the C99 spec is section 6.7.5.2:
In addition to optional type qualifiers and the keyword static, the [ and ] may delimit an expression or *. If they delimit an expression (which specifies the size of an array), the expression shall have an integer type. If the expression is a constant expression, it shall have a value greater than zero. The element type shall not be an incomplete or function type. The optional type qualifiers and the keyword static shall appear only in a declaration of a function parameter with an array type, and then only in the outermost array type derivation.
This suggests that on my C166 16 bit target, the following is legal:
char a[32000]; // no problems int b[32000]; // still fits in 64k page long c[32000]; // legal but too big for a page
However,
char d[64000]; // 64000 isn't an int
No, the standard only says that it should be of an integer data type. long int is also an integer data type, so
char d[64000];
is valid even if int is 16-bit and the value 64000 too large to store in an int. However, since the standard doesn't specify the max total size requirements of an array, or the minimum range an array index must be able to span, it is up to the compiler vendor (or the architecture) to set the limit.
A lot of 8 and 16-bit devices are not able to address more than a 16-bit range. Some may support (with more or less compiler magic) to support a huge data type breaking the 64kB wall. Hence, a source analysation program is correct to warn if it detects code that uses a long int for declaring the array size - a lot of compilers will fail to compile the code.
A compiler that does not accept 65530 does not break any C requirements that I have found.
On the other hand: It should be considered a bonus if the Keil compiler supports long int as array size - or notes that the constant 65530 is a long int but that the value still fits in a 16 bit unsigned int, and so is within the capability of the architecture.