From 680f1a39ee4b6cd2fb4dcf3de195bd58626b9525 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Tue, 3 Jun 2025 15:19:04 +0100 Subject: libc: Allow more complex expressions for CALL_BLOCK first argument For the case where the compiler supports blocks we only allow the first expression to have an operator if it has as high precedence as a function call, which for blocks effectively means member access and subscripting only, not even a dereference nor a cast. Parenthesise this, as is the case for the missing compiler support case, so that it's more general. --- lib/libc/include/block_abi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/include/block_abi.h b/lib/libc/include/block_abi.h index e04998d6148d..cf670c6c079e 100644 --- a/lib/libc/include/block_abi.h +++ b/lib/libc/include/block_abi.h @@ -37,7 +37,7 @@ * compilers that support blocks and exposing the ABI in the source for other * compilers. */ -#define CALL_BLOCK(name, ...) name(__VA_ARGS__) +#define CALL_BLOCK(name, ...) (name)(__VA_ARGS__) #else // !__BLOCKS__ #define DECLARE_BLOCK(retTy, name, argTys, ...)\ struct {\ -- cgit v1.2.3