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.

Compiler/AM4372: about #pragma RETAIN

Part Number: AM4372

Tool/software: TI C/C++ Compiler

Hi all,

Can I use the RETAIN pragma for static variables?

When I used the RETAIN pragma for global variables, this variable was kept in the map file.

However, using the RETAIN pragma for static variables, this variable was not kept in the map file.

I'd like to know how static variables are not removed by optimization.

Best regards,

Sasaki