I've just read in the Code Composer Studio v4.2 Users Guide for MSP430:
B.5.1 Initializing Static and Global Variables
The ANSI/ISO C standard specifies that static and global (extern) variables without explicit initializations
must be pre-initialized to 0 (before the program begins running). This task is typically performed when the
program is loaded and is implemented in the IAR compiler:
/* IAR, global variable, initialized to 0 upon program start */
int Counter;
However, the TI CCS compiler does not pre-initialize these variables; therefore, it is up to the application
to fulfill this requirement:
/* CCS, global variable, manually zero-initialized */
int Counter = 0;
Please, can someone tell me that this is just a bad joke? I used CCS for a TMS320F241 DSP chip something like 12 years ago, and wasted a lot of time finding out about this problem. After all, you don't expect your problems to be caused by the compiler failing to follow one of the most basic functions of a C compiler. But it is hard to comprehend that this is the case in the current tools.