Exactly my point. The error message does not match the code.
Here is the code:
/* Render the number nicely from the given item into a string. */
static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
{
unsigned char *output_pointer = NULL;
double d = item->valuedouble;
int length = 0;
size_t i = 0;
unsigned char number_buffer[26] = {0}; /* temporary buffer to print the number into */
unsigned char decimal_point = get_decimal_point();
double test = 0.0;
if (output_buffer == NULL)
{
return false;
}
/* This checks for NaN and Infinity */
if (isnan(d) || isinf(d))
{
length = sprintf((char*)number_buffer, "null");
}
else
{ ..........
And here is the compiler error:
C:\mcuxpresso_workspace\sdm_01\Debug/../source/cJSON.c:562: undefined reference to `__isnand'
If I CTRL-click on the isnan in the code, then it takes me to the definition in math.h as expected.
So, why the compiler error? The code looks OK to me.
Thanks,
-Nick