In Ada, every unconstrained array also carries information on its array bounds. This is traditionally called the array “dope.” So when an array is passed, we also need to pass information on the low and high bound of the array, which is represented as a 2-word array of integers in the generated C code. Note that you can gain some control over this by using pragma Export or pragma Convention in the original Ada code. For example, by specifying the Convention is “C”, it will only pass the address of the first element of the array, and presume the called routine has some other way of knowing the high bound (e.g. a null terminator or a separate parameter).
MapuSoft
Comments