]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Enable an aggressive warning C4706 on MSVC.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 19 Feb 2012 22:25:00 +0000 (07:25 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Sun, 19 Feb 2012 22:25:00 +0000 (07:25 +0900)
CMakeLists.txt
libarchive/archive_match.c

index fa3f868bf54b28b3390ae7a9ff218f69c7d50903..02174036eb507589ec8e91f53806f9bbaa5c47d7 100644 (file)
@@ -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
index f63d07bcc349d5b1112165ceac74175b0f97bbe7..6b533e6ba94d4d2f49ae162b285448df46492adf 100644 (file)
@@ -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++;