Re: Keil c51 interprets &Array as Array. Is that normal?
- From: sprocket <jas@xxxxxxxxxxx>
- Date: Fri, 11 Apr 2008 14:48:04 +0100
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.
.
- Follow-Ups:
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Robert Adsett
- Re: Keil c51 interprets &Array as Array. Is that normal?
- References:
- Keil c51 interprets &Array as Array. Is that normal?
- From: Bill Davy
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Hans-Bernhard Bröker
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Andrey Tarasevich
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Tim Wescott
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Andrey Tarasevich
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Bill Davy
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Robert Adsett
- Keil c51 interprets &Array as Array. Is that normal?
- Prev by Date: Re: Keil c51 interprets &Array as Array. Is that normal?
- Next by Date: Re: Keil c51 interprets &Array as Array. Is that normal?
- Previous by thread: Re: Keil c51 interprets &Array as Array. Is that normal?
- Next by thread: Re: Keil c51 interprets &Array as Array. Is that normal?
- Index(es):
Relevant Pages
|