Check the compiler documentation. The appropriate C or C ++ compiler is needed to initialize all elements to 0 , but some compilers, especially in the built-in world, have parameters other than ISO (sometimes set by default!) To tune the implementation for performance reasons.
In particular, for your compiler, check if you are in COFF ABI mode:
6.13 Initializing Static and Global Variables in COFF ABI Mode
The ANSI / ISO C standard indicates that global (external) and static variables without explicit initializations should be initialized to 0 before starting the program. This task is usually performed when the program is loaded. Since the boot process is highly dependent on the specific environment of the target application system, in COFF ABI mode, the compiler itself does not provide initialization to 0; otherwise, uninitialized variables of the static storage class at run time. This requirement depends on your application.
Initialize global objects
NOTE. You must explicitly initialize all global objects that you expected to be set to zero by default by the compiler. In C6000 EABI mode, uninitialized variables are automatically initialized to zeros.
from "Optimization of the compiler TMS320C6000 v7.4 User Guide"
http://www.ti.com/lit/ug/spru187u/spru187u.pdf
source share