Created
March 8, 2013 15:43
-
-
Save kaworu/5117338 to your computer and use it in GitHub Desktop.
gcc48 pkgng patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libpkg/private/pkg.h b/libpkg/private/pkg.h | |
index f6ad119..a92fdcf 100644 | |
--- a/libpkg/private/pkg.h | |
+++ b/libpkg/private/pkg.h | |
@@ -70,8 +70,7 @@ | |
struct type *hf1, *hf2; \ | |
HASH_ITER(hh, data, hf1, hf2) { \ | |
HASH_DEL(data, hf1); \ | |
- if (free_func != NULL) \ | |
- free_func(hf1); \ | |
+ free_func(hf1); \ | |
} \ | |
data = NULL; \ | |
} while (0) | |
@@ -80,8 +79,7 @@ | |
struct type *l1, *l2; \ | |
LL_FOREACH_SAFE(head, l1, l2) { \ | |
LL_DELETE(head, l1); \ | |
- if (free_func != NULL) \ | |
- free_func(l1); \ | |
+ free_func(l1); \ | |
} \ | |
head = NULL; \ | |
} while (0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GCC complains that the test
(free_func != NULL)
is always true and it is right, but removing this part we actually lose some functionality. On the other hand, reverting this patch when a case withfree_func == NULL
will arise is gonna be easy.I dislike this patch a lot, maybe we should find a way to prevent GCC to complain about this one.