This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28069: Compiler Bug - initialisation of static array inside function

Part Number: TMS320F28069

I've found a bug in the C2000 compiler version TMS320C2000 v21.6.0.LTS.

In the C programming language, if you want to initialise a static array to all zeroes, you must do:

    static int monkey[5u] =  { 0 };

In the C++ programming language, you don't need that 0 in there -- you can just do:

    static int monkey[5u] =  {};

The C2000 compiler requires the former syntax even though it's a C++ compiler. If you use the latter syntax, the array does not get initialised to all zeroes.

I spent a few hours this morning debugging code wondering why it was malfunctioning, until I discovered that the array wasn't zero-initialised.