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 WarninG

Hello Community,

I am doing not that much with CCS but with other compilers.
Now I have a silly question:
Why does the following code give no warnings/errors/remaks - nothing?

int main(void) {
    
    int test16;
    long long test32 = 0xFFFFFFFF;

    test16 = test32;

    test16 = test16;

    return 0;
}

I think If a 32 bit value is written to an 16 bit value the compiler has to warn me by default. I also have not figured out how to tell the compiler to do this. I dont want to use misra. Or do I have to use it in CCS?
Could anyone please explain me this behavior?

Thanks,

Joachim

  • j.stuempfl said:
    I think If a 32 bit value is written to an 16 bit value the compiler has to warn me by default.

    Checks like this are not a strong point of the TI compiler.  There are many other tools which focus on that task.  I recommend you do an internet search on the term static code analysis.  

    Thanks and regards,

    -George