When analysing a project which has its own isolated math library, cppcheck chokes on definitions of float infinity. The code below is pretty much like many c libraries define those macros.
file fail.c:
#if 100*__GNUC__+__GNUC_MINOR__ >= 303 || defined(__clang__) #define NAN __builtin_nanf("") #define INFINITY __builtin_inff() #else #define NAN (0.0f/0.0f) #define INFINITY 1e5000f #endif int main(int argc) { return INFINITY + argc; }
Calling cppcheck on it:
/tmp/lano/tmp_dir/fail.c:0:0: error: Internal Error. MathLib::toDoubleNumber: conversion failed: 1e5000f [cppcheckError]
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12085
Log in to post a comment.
When analysing a project which has its own isolated math library,
cppcheck chokes on definitions of float infinity. The code below is
pretty much like many c libraries define those macros.
file fail.c:
Calling cppcheck on it:
/tmp/lano/tmp_dir/fail.c:0:0: error: Internal Error. MathLib::toDoubleNumber: conversion failed: 1e5000f [cppcheckError]
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12085