compiler bug ??

07 Apr 2016

If I compile the following program and load it onto my MK64F, it does NOT run??? if I uncomment the i==14 line, it compiles and runs just fine ???

#include "mbed.h"
#include <stdint.h>

        float Qw12x12[12][12];          // covariance matrix Qw
DigitalOut gpo(D0);
DigitalOut led(LED_RED);

void fcn() {
        int8_t i, j;
        for (i = 0; i < 12; i++) {
        for (j = 0; j < 12; j++) {
            Qw12x12[i][j] = 0.0F;
 //       if (i==14) printf("ij %d %d\n",i,j);   
        }
    }
}

int main()
{
    fcn();
    printf("going\n");
    while (true) {
        gpo = !gpo; // toggle pin
        led = !led; // toggle led
        wait(0.2f);
    }
}
08 Apr 2016

Curious one, however int8_t is a 'signed 8 bit number' or signed char

try uint_8t 'unsigned 8 bit number

or use char

Some compilers complain that using signed char types may cause problems with array subscripts

just tried with char and uint8_t both work with your code