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



Robert Adsett wrote:
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.

mspgcc shouts "main.c:45: warning: assignment from incompatible pointer type"

which is about right.
.