Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Build fails with -Werror: `warning: passing argument 1 of ‘__inline_isnanf’ as ‘float’ rather than ‘double’ due to prototype`

Đang mở
#1,012 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 12 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
c, cmake
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với cJSON.c tại print_number, khoảng dòng 607, và tái hiện lỗi bằng cấu hình GCC 4.2/CMake được nêu với -Werror. Xem xét các chẩn đoán của trình biên dịch, bao gồm cả các cảnh báo liên quan trong cJSON.c, và xác minh rằng dự án được build thành công với cấu hình này mà không gặp lỗi đã báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

--->  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
Ngôn ngữ chính
C
Star
13k
Fork
3.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DaveGamble/cJSON

Tất cả issue của DaveGamble/cJSON

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.