libcheck / check

A unit testing framework for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Warnings when building on Windows platform with MSVC

vmo6trl opened this issue · comments

Hello,

We are using MSVC to build the check lib under windows and we obtained a few warnings which might lead to some issues at runtime.
Please feel free to ask if you need further details to investigate the console output below.

Best regards,
Vincent

check-0.14.0\src\check_pack.c(146): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
check-0.14.0\src\check_pack.c(183): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
check-0.14.0\src\check_pack.c(271): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
check-0.14.0\src\check_pack.c(292): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
check-0.14.0\src\check_pack.c(346): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
check-0.14.0\src\check_pack.c(480): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
  check_print.c
  check_run.c
check-0.14.0\src\check_run.c(425): warning C4244: 'function': conversion from 'time_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
  check_str.c
  fpclassify.c
  clock_gettime.c
  timer_create.c
  timer_delete.c
  timer_settime.c
check-0.14.0\lib\timer_settime.c(42): warning C4244: 'initializing': conversion from 'const time_t' to 'int', possible loss of data [check-0.14.0\build\src\check.vcxproj]
  getline.c
check-0.14.0\lib\getline.c(42): warning C4018: '>=': signed/unsigned mismatch [check-0.14.0\build\src\check.vcxproj]
  gettimeofday.c
  localtime_r.c
  strsignal.c
  alarm.c
  Generating Code...
  check.vcxproj -> check-0.14.0\build\src\RelWithDebInfo\check.lib
  Building Custom Rule check-0.14.0/src/CMakeLists.txt
  check.c
  check_error.c
  check_list.c
  check_log.c
  check_msg.c
  check_pack.c
check-0.14.0\src\check_pack.c(146): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
check-0.14.0\src\check_pack.c(183): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
check-0.14.0\src\check_pack.c(271): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
check-0.14.0\src\check_pack.c(292): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
check-0.14.0\src\check_pack.c(346): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
check-0.14.0\src\check_pack.c(480): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
  check_print.c
  check_run.c
check-0.14.0\src\check_run.c(425): warning C4244: 'function': conversion from 'time_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
  check_str.c
  fpclassify.c
  clock_gettime.c
  timer_create.c
  timer_delete.c
  timer_settime.c
check-0.14.0\lib\timer_settime.c(42): warning C4244: 'initializing': conversion from 'const time_t' to 'int', possible loss of data [check-0.14.0\build\src\checkShared.vcxproj]
  getline.c
check-0.14.0\lib\getline.c(42): warning C4018: '>=': signed/unsigned mismatch [check-0.14.0\build\src\checkShared.vcxproj]
  gettimeofday.c
  localtime_r.c
  strsignal.c
  alarm.c
  Generating Code...
     Creating library check-0.14.0/build/src/RelWithDebInfo/checkDynamic.lib and object check-0.14.0/build/src/RelWithDebInfo/checkDynamic.exp
  checkShared.vcxproj -> check-0.14.0\build\src\RelWithDebInfo\checkDynamic.dll
  Building Custom Rule check-0.14.0/tests/CMakeLists.txt
  check_check_exit.c
  check_check_fixture.c
  check_check_fork.c
  check_check_limit.c
  check_check_log.c
  check_check_log_internal.c
  check_check_main.c
  check_check_master.c
check-0.14.0\tests\check_check_master.c(480): warning C4101: 'reg_err': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_master.c(481): warning C4101: 'err_text': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_master.c(655): warning C4101: 'line_no': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_master.c(657): warning C4101: 'number_failed': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_master.c(658): warning C4101: 'tr': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_master.c(938): warning C4028: formal parameter 1 different from declaration [check-0.14.0\build\tests\check_check.vcxproj]
  check_check_msg.c
  check_check_pack.c
  check_check_selective.c
  check_check_sub.c
check-0.14.0\tests\check_check_sub.c(595): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(621): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(647): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(674): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(700): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(727): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(796): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(828): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(863): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(898): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(982): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1007): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1037): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1095): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1106): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1611): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1622): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check.vcxproj]
  check_check_tags.c
check-0.14.0\tests\check_check_tags.c(667): warning C4101: 'tag_plus_suite_env': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_tags.c(667): warning C4101: 'tag_plus_case_env': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_tags.c(661): warning C4101: 'set_get_tags': unreferenced local variable [check-0.14.0\build\tests\check_check.vcxproj]
  check_list.c
  Generating Code...
check-0.14.0\tests\check_check_sub.c(967): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(962): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(950): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1456): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1466): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1483): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1478): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1510): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1505): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(994): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(989): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1974): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(2001): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1996): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(2028): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(2023): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(1984): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
check-0.14.0\tests\check_check_sub.c(940): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check.vcxproj]
  check_check.vcxproj -> check-0.14.0\build\tests\RelWithDebInfo\check_check.exe
  Building Custom Rule check-0.14.0/tests/CMakeLists.txt
  check_check_sub.c
check-0.14.0\tests\check_check_sub.c(595): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(621): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(647): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(674): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(700): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(727): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(796): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(828): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(863): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(898): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(982): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1007): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1037): warning C4244: 'initializing': conversion from 'int' to 'float', possible loss of data [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1095): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1106): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1611): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1622): warning C4305: 'initializing': truncation from 'double' to 'float' [check-0.14.0\build\tests\check_check_export.vcxproj]
  check_check_master.c
check-0.14.0\tests\check_check_master.c(480): warning C4101: 'reg_err': unreferenced local variable [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_master.c(481): warning C4101: 'err_text': unreferenced local variable [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_master.c(655): warning C4101: 'line_no': unreferenced local variable [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_master.c(657): warning C4101: 'number_failed': unreferenced local variable [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_master.c(658): warning C4101: 'tr': unreferenced local variable [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_master.c(938): warning C4028: formal parameter 1 different from declaration [check-0.14.0\build\tests\check_check_export.vcxproj]
  check_check_log.c
  check_check_fork.c
  check_check_export_main.c
  Generating Code...
check-0.14.0\tests\check_check_sub.c(940): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(994): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(989): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1456): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1466): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1483): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1478): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(950): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1974): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1984): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(2001): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1996): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1510): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(1505): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(967): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(962): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(2028): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
check-0.14.0\tests\check_check_sub.c(2023): warning C4723: potential divide by 0 [check-0.14.0\build\tests\check_check_export.vcxproj]
  check_check_export.vcxproj -> check-0.14.0\build\tests\RelWithDebInfo\check_check_export.exe
  Building Custom Rule check-0.14.0/tests/CMakeLists.txt
  check_nofork.c
  check_nofork.vcxproj -> check-0.14.0\build\tests\RelWithDebInfo\check_nofork.exe
  Building Custom Rule check-0.14.0/tests/CMakeLists.txt
  check_nofork_teardown.c
  check_nofork_teardown.vcxproj -> check-0.14.0\build\tests\RelWithDebInfo\check_nofork_teardown.exe
  Building Custom Rule check-0.14.0/tests/CMakeLists.txt
  check_set_max_msg_size.c
check-0.14.0\tests\check_set_max_msg_size.c(55): warning C4101: 'n': unreferenced local variable [check-0.14.0\build\tests\check_set_max_msg_size.vcxproj]
  check_set_max_msg_size.vcxproj -> check-0.14.0\build\tests\RelWithDebInfo\check_set_max_msg_size.exe
  Building Custom Rule check-0.14.0/lib/CMakeLists.txt
  libcompat.c
  fpclassify.c
  clock_gettime.c
  timer_create.c
  timer_delete.c
  timer_settime.c
check-0.14.0\lib\timer_settime.c(42): warning C4244: 'initializing': conversion from 'const time_t' to 'int', possible loss of data [check-0.14.0\build\lib\compat.vcxproj]
  getline.c
check-0.14.0\lib\getline.c(42): warning C4018: '>=': signed/unsigned mismatch [check-0.14.0\build\lib\compat.vcxproj]

Hi @vmo6trl, thank you for the heads up, I appreciate it. I'm going through these warnings now