From 9d9cfa6bd2dd1d12bca3194b4f462015611d77d2 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Sat, 25 Feb 2012 16:45:19 +0900 Subject: [PATCH] Enable C4254,C4295,C4514 and C4702 on MSVC. --- CMakeLists.txt | 12 ++++++++++++ libarchive/archive_read.c | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcaf84318..3aca2bea3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,13 @@ IF (MSVC) # Enable level 4 C4061: The enumerate has no associated handler in a switch # statement. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + # Enable level 4 C4295: An array was initialized but the last character in + # the array is not a null; accessing the array may + # produce unexpected results. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") # Enable level 4 C4296: An unsigned variable was used in a comparison # operation with zero. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296") @@ -86,6 +93,11 @@ IF (MSVC) # the body of the module; therefore, the function is # dead code. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505") + # Enable level 4 C4514: The optimizer removed an inline function that is not + # called. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514") + # Enable level 4 C4702: Unreachable code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702") # Enable level 4 C4706: The test value in a conditional expression was the # result of an assignment. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index 42eb06192..e99906f82 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -201,7 +201,6 @@ client_skip_proxy(struct archive_read_filter *self, int64_t request) request -= get; total += get; } - return total; } else if (self->archive->client.seeker != NULL && request > 64 * 1024) { /* If the client provided a seeker but not a skipper, -- 2.47.3