diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | reloc.h | 2 | ||||
-rw-r--r-- | test/test_reloc_match.c | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f17030..e24cc1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,8 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra") elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /Wall") + # C4996: The POSIX name for this item is deprecated + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /W4 /wd4996") endif() enable_testing() @@ -15,7 +15,7 @@ #define SIZE_T_FMT "%I64u" #elif defined(_MSC_VER) #define DIRSEP '\\' -#define SIZE_T_FMT "%lu" +#define SIZE_T_FMT "%zu" #elif defined(__linux__) || defined(__unix__) || defined(__APPLE__) || defined(__MACH__) #define DIRSEP '/' #define SIZE_T_FMT "%lu" diff --git a/test/test_reloc_match.c b/test/test_reloc_match.c index bb9d6b0..ed725cd 100644 --- a/test/test_reloc_match.c +++ b/test/test_reloc_match.c @@ -72,11 +72,11 @@ int test_reloc_match() { myassert("Invalid match->end", match->end != NULL); printf("\tpost=\"%s\", data=\"%s\"\n", match->post, match->begin); myassert("Invalid match->post", !strcmp(match->post, test_solution_post[i])); - printf("\tlength=%lu\n", match->length); + printf("\tlength=" SIZE_T_FMT "\n", match->length); myassert("Invalid match->length", match->length == test_solution_length[i]); - printf("\tpost_length=%lu\n", match->post_length); + printf("\tpost_length=" SIZE_T_FMT "\n", match->post_length); myassert("Invalid match->post_length", match->post_length == test_solution_post_length[i]); - printf("\ttotal_length=%lu\n", match->total_length); + printf("\ttotal_length=" SIZE_T_FMT "\n", match->total_length); myassert("Invalid match->total_length", match->total_length == test_solution_total_length[i]); if (match) { free(match); |