From: Michihiro NAKAJIMA Date: Sun, 19 Feb 2012 22:25:00 +0000 (+0900) Subject: Enable an aggressive warning C4706 on MSVC. X-Git-Tag: v3.0.4~2^2~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01799b51a48d3fd4ac093b7dc73b209248e5f38f;p=thirdparty%2Flibarchive.git Enable an aggressive warning C4706 on MSVC. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fa3f868bf..02174036e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,11 @@ IF (MSVC) SET(CMAKE_REQUIRED_FLAGS "/WX") # Set compile flags for all build types. SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + # 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") ENDIF (MSVC) # Enable CTest/CDash support diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c index f63d07bcc..6b533e6ba 100644 --- a/libarchive/archive_match.c +++ b/libarchive/archive_match.c @@ -694,8 +694,8 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) matched = NULL; for (match = a->inclusions.first; match != NULL; match = match->next){ - if (match->matches == 0 - && (r = match_path_inclusion(a, match, mbs, pathname))) { + if (match->matches == 0 && + (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); a->inclusions.unmatched_count--; @@ -722,8 +722,8 @@ path_excluded(struct archive_match *a, int mbs, const void *pathname) for (match = a->inclusions.first; match != NULL; match = match->next){ /* We looked at previously-unmatched inclusions already. */ - if (match->matches > 0 - && (r = match_path_inclusion(a, match, mbs, pathname))) { + if (match->matches > 0 && + (r = match_path_inclusion(a, match, mbs, pathname)) != 0) { if (r < 0) return (r); match->matches++;