Re: Keil c51 interprets &Array as Array. Is that normal?
- From: Robert Adsett <sub2@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 11 Apr 2008 06:40:56 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Keil c51 interprets &Array as Array. Is that normal?
- From: sprocket
- 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
- 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):