aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Schuberth <sschuberth@gmail.com>2012-12-11 21:34:51 +0100
committerJunio C Hamano <gitster@pobox.com>2012-12-11 22:10:22 -0800
commit8e679e08a6e12e183aeb068a2ff5d75599d6433d (patch)
tree04217384d1f655863c3cde380329a0763d75b93f
parent7e0651a6302b50db4bac1e65da61c4036cc64d2a (diff)
downloadgit-8e679e08a6e12e183aeb068a2ff5d75599d6433d.tar.gz
git-8e679e08a6e12e183aeb068a2ff5d75599d6433d.tar.xz
nedmalloc: Fix a compile warning (exposed as error) with GCC 4.7.2
On MinGW, GCC 4.7.2 complains about operation on 'p->m[end]' may be undefined Fix this by replacing the faulty lines with those of 69825ca from https://github.com/ned14/nedmalloc/blob/master/nedmalloc.c Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--compat/nedmalloc/nedmalloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c
index d9a17a805..91c4e7f27 100644
--- a/compat/nedmalloc/nedmalloc.c
+++ b/compat/nedmalloc/nedmalloc.c
@@ -603,7 +603,10 @@ static NOINLINE mstate FindMSpace(nedpool *p, threadcache *tc, int *lastUsed, si
}
/* We really want to make sure this goes into memory now but we
have to be careful of breaking aliasing rules, so write it twice */
- *((volatile struct malloc_state **) &p->m[end])=p->m[end]=temp;
+ {
+ volatile struct malloc_state **_m=(volatile struct malloc_state **) &p->m[end];
+ *_m=(p->m[end]=temp);
+ }
ACQUIRE_LOCK(&p->m[end]->mutex);
/*printf("Created mspace idx %d\n", end);*/
RELEASE_LOCK(&p->mutex);