This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
pass bounded array as unbounded
- From: Daniel Bengtsson <Danesh dot D at bredband dot net>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 3 Oct 2007 12:47:19 -0700 (PDT)
- Subject: pass bounded array as unbounded
Hi all,
I have a already written code in C which should be compiled using GCC. In
this code there is an 4x3 array which will be passed to a function as
unbounded array:
int arr[4][3]
myFunc (int myArray[][3])
{
int temp=myArray[7][0]
}
In this function, values out of boundaries of input array is used (like the
code above). Now I have these questions:
1. Why I get no error when values out of boundary is used?
2. I have checked that for example value of the element [7][0] always has
same value! I expected at least that this contain random value while it is
not allocated before. Does GCC fill it with something else or it depends to
value of other elements in array?
Thanks for help!
D.
--
View this message in context: http://www.nabble.com/pass-bounded-array-as-unbounded-tf4563990.html#a13026492
Sent from the gcc - Dev mailing list archive at Nabble.com.