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.
Dear forum team,
I expected a compiler warning or error with the following illegal assignment:
uint16_t var = 0x11223;
But actually only this assignment causes an error:
uint16_t var = 0x1122334455667788A;
-> error #23: integer constant is too large
Question:
is there a switch so that the compiler generally reports assignments that are larger than allowed?
Dieter
Strange. I do get a #70 warning for your code snippet:
#70-D integer conversion resulted in truncation
There's a small chance the diagnostic is suppressed:
Seems there is a Compiler switch anywhere. I will try to find it with your warning code.
We are using an external makefile and not the integrated build in CCS.
Hi
I can also reproduce this on the command line. If the error is being suppressed, it isn't the compiler that's doing it, but likely something in the project build/CCS.
Hello,
To confirm, you are not seeing an error when compiling with your external makefile, correct? If so, this may require you to look into the compiler settings of whatever you're using outside of CCS, this is not something we inherently support.
Best regards,
Omer Amir
The issue has been resolved: e2e.ti.com/.../tms320f28377d-no-compiler-warning-when-assigning-a-too-large-number-to-uint16_t-found-solution