DaveGamble/cJSON

conversion error in gcc x86_64-w64-mingw32

GwXyCc opened this issue · 1 comments

conversion from 'double' to 'float' may change value [-Werror=float-conversion]
This error in cJson.c file,line 569,35 columns
How can i solve this error?

same issue here:

C:\msys64\mingw64\bin\cc.exe -DCJSON_API_VISIBILITY -DCJSON_EXPORT_SYMBOLS -DENABLE_LOCALES  -std=c89 -pedantic -Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wundef -Wswitch-default -Wconversion -Wc++-compat -fstack-protector-strong -Wdouble-promotion -Wparentheses -Wformat-overflow -Wunused-macros -Wmissing-variable-declarations -Wswitch-enum -fvisibility=hidden -std=gnu11 -MD -MT src/external_libs/cjson/CMakeFiles/cjson.dir/cJSON.c.obj -MF src\external_libs\cjson\CMakeFiles\cjson.dir\cJSON.c.obj.d -o src/external_libs/cjson/CMakeFiles/cjson.dir/cJSON.c.obj -c external/cJSON/cJSON.c
In file included from external/cJSON/cJSON.c:42:
external/cJSON/cJSON.c: In function 'print_number':
external/cJSON/cJSON.c:580:27: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion]
  580 |     if (isnan(d) || isinf(d))
      |                           ^
cc1.exe: all warnings being treated as errors