From 5c26c890ede40b5649d2ea23c51ea3ef34216486 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 15 Apr 2024 03:26:17 -0700 Subject: 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. --- src/malloc/mallocng/glue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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() { -- cgit v1.2.1