Build fails with -Werror: `warning: passing argument 1 of ‘__inline_isnanf’ as ‘float’ rather than ‘double’ due to prototype`
维护者通常 12 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- c, cmake
- 领域
- build-system
调研方向
从 cJSON.c 中 print_number 附近的第 607 行开始,使用所示的带有 -Werror 的 GCC 4.2/CMake 配置复现该失败。检查编译器诊断信息,包括 cJSON.c 中相关的警告,并验证项目在此配置下能够成功构建且不会出现所报告的失败。
由索引模型根据 Issue 内容生成。
描述
---> Configuring cjson
Warning: ccache_dir /opt/local/var/macports/build/.ccache could not be initialized; disabling ccache: couldn't execute "ccache": no such file or directory
(using ccache)
Executing: cd "/opt/local/var/macports/build/cjson-f14d8dea/work/build" && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DBUILD_SHARED_AND_STATIC_LIBS=ON -DENABLE_CJSON_UTILS=ON -DENABLE_CJSON_TEST=OFF -DCMAKE_OSX_ARCHITECTURES="ppc" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19
-- The C compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc-4.2 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test FLAG_SUPPORTED_stdc89
-- Performing Test FLAG_SUPPORTED_stdc89 - Success
-- Performing Test FLAG_SUPPORTED_pedantic
-- Performing Test FLAG_SUPPORTED_pedantic - Success
-- Performing Test FLAG_SUPPORTED_Wall
-- Performing Test FLAG_SUPPORTED_Wall - Success
-- Performing Test FLAG_SUPPORTED_Wextra
-- Performing Test FLAG_SUPPORTED_Wextra - Success
-- Performing Test FLAG_SUPPORTED_Werror
-- Performing Test FLAG_SUPPORTED_Werror - Success
-- Performing Test FLAG_SUPPORTED_Wstrictprototypes
-- Performing Test FLAG_SUPPORTED_Wstrictprototypes - Success
-- Performing Test FLAG_SUPPORTED_Wwritestrings
-- Performing Test FLAG_SUPPORTED_Wwritestrings - Success
-- Performing Test FLAG_SUPPORTED_Wshadow
-- Performing Test FLAG_SUPPORTED_Wshadow - Success
-- Performing Test FLAG_SUPPORTED_Winitself
-- Performing Test FLAG_SUPPORTED_Winitself - Success
-- Performing Test FLAG_SUPPORTED_Wcastalign
-- Performing Test FLAG_SUPPORTED_Wcastalign - Success
-- Performing Test FLAG_SUPPORTED_Wformat2
-- Performing Test FLAG_SUPPORTED_Wformat2 - Success
-- Performing Test FLAG_SUPPORTED_Wmissingprototypes
-- Performing Test FLAG_SUPPORTED_Wmissingprototypes - Success
-- Performing Test FLAG_SUPPORTED_Wstrictoverflow2
-- Performing Test FLAG_SUPPORTED_Wstrictoverflow2 - Success
-- Performing Test FLAG_SUPPORTED_Wcastqual
-- Performing Test FLAG_SUPPORTED_Wcastqual - Success
-- Performing Test FLAG_SUPPORTED_Wundef
-- Performing Test FLAG_SUPPORTED_Wundef - Success
-- Performing Test FLAG_SUPPORTED_Wswitchdefault
-- Performing Test FLAG_SUPPORTED_Wswitchdefault - Success
-- Performing Test FLAG_SUPPORTED_Wconversion
-- Performing Test FLAG_SUPPORTED_Wconversion - Success
-- Performing Test FLAG_SUPPORTED_Wccompat
-- Performing Test FLAG_SUPPORTED_Wccompat - Success
-- Performing Test FLAG_SUPPORTED_fstackprotectorstrong
-- Performing Test FLAG_SUPPORTED_fstackprotectorstrong - Failed
-- Performing Test FLAG_SUPPORTED_Wcomma
-- Performing Test FLAG_SUPPORTED_Wcomma - Failed
-- Performing Test FLAG_SUPPORTED_Wdoublepromotion
-- Performing Test FLAG_SUPPORTED_Wdoublepromotion - Failed
-- Performing Test FLAG_SUPPORTED_Wparentheses
-- Performing Test FLAG_SUPPORTED_Wparentheses - Success
-- Performing Test FLAG_SUPPORTED_Wformatoverflow
-- Performing Test FLAG_SUPPORTED_Wformatoverflow - Failed
-- Performing Test FLAG_SUPPORTED_Wunusedmacros
-- Performing Test FLAG_SUPPORTED_Wunusedmacros - Success
-- Performing Test FLAG_SUPPORTED_Wmissingvariabledeclarations
-- Performing Test FLAG_SUPPORTED_Wmissingvariabledeclarations - Failed
-- Performing Test FLAG_SUPPORTED_Wusedbutmarkedunused
-- Performing Test FLAG_SUPPORTED_Wusedbutmarkedunused - Failed
-- Performing Test FLAG_SUPPORTED_Wswitchenum
-- Performing Test FLAG_SUPPORTED_Wswitchenum - Success
-- Performing Test FLAG_SUPPORTED_fvisibilityhidden
-- Performing Test FLAG_SUPPORTED_fvisibilityhidden - Success
-- Configuring done (11.8s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CXX_COMPILER
CMAKE_OBJCXX_COMPILER
CMAKE_OBJC_COMPILER
CMAKE_POLICY_DEFAULT_CMP0025
-- Build files have been written to: /opt/local/var/macports/build/cjson-f14d8dea/work/build
---> Building cjson
Executing: cd "/opt/local/var/macports/build/cjson-f14d8dea/work/build" && /usr/bin/make -j2 -w all VERBOSE=ON
make: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
/opt/local/bin/cmake -S/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19 -B/opt/local/var/macports/build/cjson-f14d8dea/work/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/cjson-f14d8dea/work/build/CMakeFiles /opt/local/var/macports/build/cjson-f14d8dea/work/build//CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
/usr/bin/make -f CMakeFiles/cjson.dir/build.make CMakeFiles/cjson.dir/depend
/usr/bin/make -f CMakeFiles/cjson-static.dir/build.make CMakeFiles/cjson-static.dir/depend
make[2]: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
cd /opt/local/var/macports/build/cjson-f14d8dea/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19 /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19 /opt/local/var/macports/build/cjson-f14d8dea/work/build /opt/local/var/macports/build/cjson-f14d8dea/work/build /opt/local/var/macports/build/cjson-f14d8dea/work/build/CMakeFiles/cjson.dir/DependInfo.cmake "--color="
make[2]: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
cd /opt/local/var/macports/build/cjson-f14d8dea/work/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19 /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19 /opt/local/var/macports/build/cjson-f14d8dea/work/build /opt/local/var/macports/build/cjson-f14d8dea/work/build /opt/local/var/macports/build/cjson-f14d8dea/work/build/CMakeFiles/cjson-static.dir/DependInfo.cmake "--color="
make[2]: Leaving directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
/usr/bin/make -f CMakeFiles/cjson-static.dir/build.make CMakeFiles/cjson-static.dir/build
make[2]: Leaving directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
/usr/bin/make -f CMakeFiles/cjson.dir/build.make CMakeFiles/cjson.dir/build
make[2]: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
make[2]: Entering directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
[ 12%] Building C object CMakeFiles/cjson-static.dir/cJSON.c.o
[ 25%] Building C object CMakeFiles/cjson.dir/cJSON.c.o
/usr/bin/gcc-4.2 -DCJSON_API_VISIBILITY -DCJSON_EXPORT_SYMBOLS -DENABLE_LOCALES -pipe -Os -DNDEBUG -I/opt/local/include -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 -Wparentheses -Wunused-macros -Wswitch-enum -fvisibility=hidden -arch ppc -mmacosx-version-min=10.6 -MD -MT CMakeFiles/cjson-static.dir/cJSON.c.o -MF CMakeFiles/cjson-static.dir/cJSON.c.o.d -o CMakeFiles/cjson-static.dir/cJSON.c.o -c /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c
/usr/bin/gcc-4.2 -DCJSON_API_VISIBILITY -DCJSON_EXPORT_SYMBOLS -DENABLE_LOCALES -Dcjson_EXPORTS -pipe -Os -DNDEBUG -I/opt/local/include -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 -Wparentheses -Wunused-macros -Wswitch-enum -fvisibility=hidden -arch ppc -mmacosx-version-min=10.6 -fPIC -MD -MT CMakeFiles/cjson.dir/cJSON.c.o -MF CMakeFiles/cjson.dir/cJSON.c.o.d -o CMakeFiles/cjson.dir/cJSON.c.o -c /opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c
cc1: warnings being treated as errors
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘print_number’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:607: warning: passing argument 1 of ‘__inline_isnanf’ as ‘float’ rather than ‘double’ due to prototype
cc1: warnings being treated as errors
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘print_number’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:607: warning: passing argument 1 of ‘__inline_isnanf’ as ‘float’ rather than ‘double’ due to prototype
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:607: warning: passing argument 1 of ‘__inline_isinff’ as ‘float’ rather than ‘double’ due to prototype
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:607: warning: passing argument 1 of ‘__inline_isinff’ as ‘float’ rather than ‘double’ due to prototype
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘get_array_item’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:1907: warning: declaration of ‘index’ shadows a global declaration
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘get_array_item’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:1907: warning: declaration of ‘index’ shadows a global declaration
/usr/include/string.h:125: warning: shadowed declaration is here
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cJSON_GetArrayItem’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:1926: warning: declaration of ‘index’ shadows a global declaration
/usr/include/string.h:125: warning: shadowed declaration is here
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cast_away_const’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:2060: warning: cast discards qualifiers from pointer target type
/usr/include/string.h:125: warning: shadowed declaration is here
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cJSON_GetArrayItem’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:1926: warning: declaration of ‘index’ shadows a global declaration
/usr/include/string.h:125: warning: shadowed declaration is here
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cast_away_const’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:2060: warning: cast discards qualifiers from pointer target type
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cJSON_CreateIntArray’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:2622: warning: passing argument 1 of ‘cJSON_CreateNumber’ as floating rather than integer due to prototype
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c: In function ‘cJSON_CreateIntArray’:
/opt/local/var/macports/build/cjson-f14d8dea/work/cJSON-1.7.19/cJSON.c:2622: warning: passing argument 1 of ‘cJSON_CreateNumber’ as floating rather than integer due to prototype
make[2]: *** [CMakeFiles/cjson-static.dir/cJSON.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
make[1]: *** [CMakeFiles/cjson-static.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/cjson.dir/cJSON.c.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
make[1]: *** [CMakeFiles/cjson.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/cjson-f14d8dea/work/build'
make: *** [all] Error 2
- 主要语言
- C
- 星标
- 13k
- 派生
- 3.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DaveGamble/cJSON 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
DaveGamble/cJSON#1106 ·
维护者通常 12 天内回复
-
Undefined-Behavior in function cJSON_SetNumberHelper可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
DaveGamble/cJSON#1100 · 1 个 reaction ·
维护者通常 12 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
DaveGamble/cJSON#1094 · 9 条评论 · 1 个 reaction ·
维护者通常 12 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
DaveGamble/cJSON#1093 ·
维护者通常 12 天内回复
-
Use-after-free in cJSONUtils_ApplyPatches when a patch removes the patch array可能已有人在做 @iliasabk 于 31 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
DaveGamble/cJSON#1082 ·
维护者通常 12 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
quickjs-ng/quickjs#1836 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
open-quantum-safe/liboqs#2637 ·
维护者通常 1 天内回复
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()可能已有人在做 @apoorvdarshan 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
BasedHardware/omi#22770 ·
维护者通常 1 天内回复
-
fido_do_ecdh() reports any getKeyAgreement failure as FIDO_ERR_INTERNAL可能已有人在做 @brlumen 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
joncampbell123/dosbox-x#6698 ·
维护者通常 1 天内回复