Re: Keil c51 interprets &Array as Array. Is that normal?



On Apr 11, 5:22 am, "Bill Davy" <B...@xxxxxxxxxxxxxxx> wrote:

{
char *Array = malloc(n); // Used to be fixed size, but we progressed. */
/* masses of obscuring data declarations */
char *p1 = Array;
char *p2 = &Array; /* Someone may be in for a nasty shock when they use
*p2 to access Array[0] */
}

Why would someone be in for a shock using p2? The generated code
should be the same even though there is a type mismatch in the
assignment.

then things might be more troubled. And yes, Keil compiles this without a
murmur too. Thank heavens for PCLInt.

Indeed, lint first. Compile only after lint succeeds.

Robert
.