Subject: Re: [[email-masked]: A serious bug of "ld --enable-auto-import"]
From: Kurt Roeckx <[email-masked]>
To: Charles Wilson <[email-masked]>
Cc: DJ Delorie <[email-masked]>, [email-masked], [email-masked]
Date: Sun, 26 Aug 2001 21:26:57 +0200

On Sun, Aug 26, 2001 at 12:04:51PM -0400, Charles Wilson wrote:
> 
> Since arrays ARE pointers

They are NOT the same.  The only place you can change an array
into a pointer is in a function call, because that is how an
array is passed to a function.  You can also do the same
arithmetic with pointers as you can with arrays.

To put it simple, an array allocates storage for data, while the
pointer allocates storage to hold the pointer.  You need to make
the pointer point to allocated storage.

There are other differences, like a pointer has a modifiable
lvalue, and an array hasn't.

It also generates different code when you derefence a pointer or
array.  With an array, it starts at the addres of the array, and
adds to that, while with a pointer it first has to get the
address it points to, and add to that.

Kurt

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/