Add -Wdouble-promotion compiler flag

This commit is contained in:
Max Bruckner committed 2017-03-01 11:57:07 +01:00
1 parent 40e3781e9b
commit 3f349a4258
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -41,6 +41,7 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
-Wc++-compat -Wc++-compat
-fstack-protector-strong -fstack-protector-strong
-Wcomma -Wcomma
-Wdouble-promotion
) )
endif() endif()
+1 -1
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++) for(i = 0; a && (i < (size_t)count); i++)
{ {
n = cJSON_CreateNumber(numbers[i]); n = cJSON_CreateNumber((double)numbers[i]);
if(!n) if(!n)
{ {
cJSON_Delete(a); cJSON_Delete(a);