public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* array semantic query
@ 2009-07-18  9:38 dharmendra pandit
  0 siblings, 0 replies; 5+ messages in thread
From: dharmendra pandit @ 2009-07-18  9:38 UTC (permalink / raw)
  To: gcc

Hi,

I tried the following simple code segment in gcc and it gave the
incompatible type error as mentioned below.

int main() {
int arr[10];
arr = arr;     // error: incompatible types when
                 // assigning to type ‘int[10]’ from type ‘int *’
}

Here it seems GCC is retaining the left hand side type of arr to be
array of 10 ints whereas on the right hand side
it has changed its type from array to pointer to integer. I tried
searching the relevant sections in the standard ISO C
document number WG14/N1124 justifying the above behaviour of GCC but
failed to conclude it from the specifications.
It would be of great help if someone can point me out the relevant
sections from the specs.

Thanks
Dharmendra

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-18 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6215dcff0907180232l1c7291eclbc006cabd02224a4@mail.gmail.com>
2009-07-18  9:35 ` array semantic query dharmendra pandit
     [not found]   ` <4A61A230.9000703@redhat.com>
2009-07-18 12:18     ` dharmendra pandit
2009-07-18 12:26       ` Richard Guenther
2009-07-18 12:31   ` Zoltán Kócsi
2009-07-18  9:38 dharmendra pandit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).