From 4578d3a9e143224e75ab74b14dd73865cbf0338b Mon Sep 17 00:00:00 2001 From: Kevin Sapper Date: Tue, 23 Jun 2020 09:16:26 +0200 Subject: [PATCH] Problem: WError error on macosx because NAN is a float Solution: Add explicit cast from NAN to double --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index 3cdc8fa..7518389 100644 --- a/cJSON.c +++ b/cJSON.c @@ -106,7 +106,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) { if (!cJSON_IsNumber(item)) { - return NAN; + return (double) NAN; } return item->valuedouble;