..\src\main.c:306:11: style: Ensure that integer conversions do not result in lost or misinterpreted data (casting 65536 to unsigned short) [cert-INT31-c] ptr = (uint16_t *)var; ^
It complains about casting 65536 to unsigned short, however this is a conversion to a pointer to unsigned short, so should be valid on 32-bit machine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am running into a suspected FP when checking this piece of code with Cppcheck 2.6 CERT addon:
This is flagged as cert-INT31-c violation:
It complains about casting 65536 to unsigned short, however this is a conversion to a pointer to unsigned short, so should be valid on 32-bit machine.
Thanks! I can reproduce. I have created https://trac.cppcheck.net/ticket/10782