mbeddr / mbeddr.core

The mbeddr core. An extensible C
Eclipse Public License 2.0
225 stars 77 forks source link

Error: type int16_t[...] is not a subtype of int16_t[...] #147

Closed bkolb closed 12 years ago

bkolb commented 12 years ago

See smartmeter: emeter-background in com.itemis.smartmeter.msp6733_3ph_DLMS

markusvoelter commented 12 years ago

This one looks like it is a problem with multi-dimenional arrays.

Assume we have

int[3][1] v; v[0] <--- is the type int[1] or int[3]

bkolb commented 12 years ago

It is int[1]


int a2[5][7];

A2 is an array of 5 elements, each of which is an array of 7 ints.

int i, j;
for(i = 0; i < 5; i++)
    {
    for(j = 0; j < 7; j++)
        a2[i][j] = 0;
    }
bkolb commented 12 years ago

We do it exactly the opposite way:

int16_t[5][7] x; int16_t[7] y = x[0];

--> Error: type int16_t[...] is not a subtype of int16_t[...]