Add -Wdouble-promotion compiler flag

This commit is contained in:
Max Bruckner 2017-03-01 08:58:11 +01:00
parent 40e3781e9b
commit 3f349a4258
2 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
-Wc++-compat
-fstack-protector-strong
-Wcomma
-Wdouble-promotion
)
endif()

View File

@ -1914,7 +1914,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count)
for(i = 0; a && (i < (size_t)count); i++)
{
n = cJSON_CreateNumber(numbers[i]);
n = cJSON_CreateNumber((double)numbers[i]);
if(!n)
{
cJSON_Delete(a);