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.

TMS320F28P650DK: How to make the constant default to 32 bits

Part Number: TMS320F28P650DK


Tool/software:

I discovered a large number of similar definitions like 【#define xx (0x4120 << 8) 】 in the library I was using. The program couldn't run correctly. The final problem I found was that the compiler regarded the macro as 16-bit. The following change to the program made it run normally 【#define xx (0x4120UL << 8) 】.

However, the library uses a large number of such definitions. Changing the library file is very difficult. Could you please explain how to make the compiler treat this constant as a 32-bit value?

  • The type (char, int, long, etc.) of a constant or an expression is determined by the C and C++ standards.  Unfortunately, there is no mechanism by which you can change how the compiler determines such a type.

    Thanks and regards,

    -George