Skip to content

Commit 8e679e0

Browse files
sschuberthgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7e0651a commit 8e679e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compat/nedmalloc/nedmalloc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,10 @@ static NOINLINE mstate FindMSpace(nedpool *p, threadcache *tc, int *lastUsed, si
603603
}
604604
/* We really want to make sure this goes into memory now but we
605605
have to be careful of breaking aliasing rules, so write it twice */
606-
*((volatile struct malloc_state **) &p->m[end])=p->m[end]=temp;
606+
{
607+
volatile struct malloc_state **_m=(volatile struct malloc_state **) &p->m[end];
608+
*_m=(p->m[end]=temp);
609+
}
607610
ACQUIRE_LOCK(&p->m[end]->mutex);
608611
/*printf("Created mspace idx %d\n", end);*/
609612
RELEASE_LOCK(&p->mutex);

0 commit comments

Comments
 (0)