From e4efb705e4047926b682d330b6f8883bdae6bf8c Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 11 Nov 2024 13:39:25 -0500 Subject: [PATCH] libroot: Add parentheses around third argument of ioctl. So that the cast applies to the right part in case an expression is passed. --- headers/posix/unistd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/posix/unistd.h b/headers/posix/unistd.h index 940a357b1c..f541ca07ff 100644 --- a/headers/posix/unistd.h +++ b/headers/posix/unistd.h @@ -366,8 +366,8 @@ extern int __ioctl(int fd, ulong cmd, void* argument, size_t size); #ifndef __cplusplus extern int ioctl(int fd, unsigned long op, ...); #define _IOCTL2(a, b) __ioctl(a, b, NULL, 0) -#define _IOCTL3(a, b, c) __ioctl(a, b, (void*)c, 0) -#define _IOCTL4(a, b, c, d) __ioctl(a, b, (void*)c, d) +#define _IOCTL3(a, b, c) __ioctl(a, b, (void*)(c), 0) +#define _IOCTL4(a, b, c, d) __ioctl(a, b, (void*)(c), d) #define _IOCTL(ARG1, ARG2, ARG3, ARG4, NAME, ...) NAME #define ioctl(...) _IOCTL(__VA_ARGS__, _IOCTL4, _IOCTL3, _IOCTL2)(__VA_ARGS__) #else