summaryrefslogtreecommitdiff
path: root/src/malloc
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-04-15 03:26:17 -0700
committerRich Felker <dalias@aerifal.cx>2026-03-10 22:48:21 -0400
commit5c26c890ede40b5649d2ea23c51ea3ef34216486 (patch)
treed7788a607c22df990d227d539953abf9f321e9f8 /src/malloc
parent1b76ff0767d01df72f692806ee5adee13c67ef88 (diff)
downloadmusl-5c26c890ede40b5649d2ea23c51ea3ef34216486.tar.gz
mallocng: prevent stray ';' at top-level
The LOCK_OBJ_DEF macro is used with a trailing semicolon. However, since the macro definition ends with the closing brace of a function definition, the ISO C grammar does not allow an extra semicolon. To fix this, swap the order of the two definitions, and drop the semicolon from the __malloc_lock declaration.
Diffstat (limited to 'src/malloc')
-rw-r--r--src/malloc/mallocng/glue.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/malloc/mallocng/glue.h b/src/malloc/mallocng/glue.h
index 77f4c812..8c2586fb 100644
--- a/src/malloc/mallocng/glue.h
+++ b/src/malloc/mallocng/glue.h
@@ -62,8 +62,8 @@ __attribute__((__visibility__("hidden")))
extern int __malloc_lock[1];
#define LOCK_OBJ_DEF \
-int __malloc_lock[1]; \
-void __malloc_atfork(int who) { malloc_atfork(who); }
+void __malloc_atfork(int who) { malloc_atfork(who); } \
+int __malloc_lock[1]
static inline void rdlock()
{