As a test case I have created the following code:
#include <stdint.h> #define TEST_CASE(f) f>70000.0 ? 5000 : (uint16_t)70000.0 static uint16_t test=TEST_CASE(75000);//floatConversionOverflow
The actual overflow cannot happen as the preprocesser clearly chooses 5000 for TEST_CASE(75000).
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11685
Log in to post a comment.
As a test case I have created the following code:
The actual overflow cannot happen as the preprocesser clearly chooses 5000 for TEST_CASE(75000).
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11685