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.

TMS320F28P650DH: Compiler doubt

Part Number: TMS320F28P650DH

Tool/software:

Hi,

I did a test on compiler V22.6.1.LST. Some variables were defined, but never used. No optimization, but in the map file, there are no these variables.

Is there any new change in our compiler? Default O-0?

Br, Jordan

  • I presume you build with the newer --abi=eabi.  In that case, all sections which are never referenced are automatically removed.  This automatic removal happens in the linker.  It occurs regardless of the compiler optimization level.  My guess is that all of the variables are defined in the same section.  If none of them are ever used, the linker removes the section.

    For one way to disable this behavior, please search the C28x compiler manual for the sub-chapter titled The RETAIN Pragma.

    Thanks and regards,

    -George