{"thread":{"id":"32314","subject":"[PATCH] nedmalloc: Fix a compile warning (exposed as error) with GCC 4.7.2","startedAt":"2012-12-11T20:34:51Z","lastAt":"2012-12-11T20:34:51Z","messageCount":1,"participants":["Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"204687","messageId":"50C798EB.5030408@gmail.com","threadId":"32314","inReplyTo":null,"subject":"[PATCH] nedmalloc: Fix a compile warning (exposed as error) with GCC 4.7.2","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2012-12-11T20:34:51Z","receivedAt":"2012-12-11T20:34:51Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":"On MinGW, GCC 4.7.2 complains about\n\n    operation on 'p->m[end]' may be undefined\n\nFix this by replacing the faulty lines with those of 69825ca from\n\n    https://github.com/ned14/nedmalloc/blob/master/nedmalloc.c\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n compat/nedmalloc/nedmalloc.c | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/compat/nedmalloc/nedmalloc.c b/compat/nedmalloc/nedmalloc.c\nindex d9a17a8..91c4e7f 100644\n--- a/compat/nedmalloc/nedmalloc.c\n+++ b/compat/nedmalloc/nedmalloc.c\n@@ -603,7 +603,10 @@ static NOINLINE mstate FindMSpace(nedpool *p, threadcache *tc, int *lastUsed, si\n \t\t}\n \t\t/* We really want to make sure this goes into memory now but we\n \t\thave to be careful of breaking aliasing rules, so write it twice */\n-\t\t*((volatile struct malloc_state **) &p->m[end])=p->m[end]=temp;\n+\t\t{\n+\t\t\tvolatile struct malloc_state **_m=(volatile struct malloc_state **) &p->m[end];\n+\t\t\t*_m=(p->m[end]=temp);\n+\t\t}\n \t\tACQUIRE_LOCK(&p->m[end]->mutex);\n \t\t/*printf(\"Created mspace idx %d\\n\", end);*/\n \t\tRELEASE_LOCK(&p->mutex);\n-- \n1.8.0.msysgit.1\n"}]}