This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]