[vlc-commits] posix/wait: do not use alignof on expression

Marvin Scholz git at videolan.org
Fri Aug 14 16:03:03 CEST 2020


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Aug  7 06:43:18 2020 +0200| [3e41fd23726f47fb99325ec7bcfb19b0f2f37343] | committer: Marvin Scholz

posix/wait: do not use alignof on expression

Using alignof not on a type but an expression is a GNU extension and
causes the following warning:

   warning: '_Alignof' applied to an expression is a GNU extension

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e41fd23726f47fb99325ec7bcfb19b0f2f37343
---

 src/posix/wait.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/posix/wait.c b/src/posix/wait.c
index 584cc493b1..3fa6890193 100644
--- a/src/posix/wait.c
+++ b/src/posix/wait.c
@@ -52,7 +52,7 @@ static struct wait_bucket
 static struct wait_bucket *wait_bucket_get(atomic_uint *addr)
 {
     uintptr_t u = (uintptr_t)addr;
-    size_t idx = (u / alignof (*addr)) % ARRAY_SIZE(wait_buckets);
+    size_t idx = (u / alignof (atomic_uint)) % ARRAY_SIZE(wait_buckets);
 
     return &wait_buckets[idx];
 }



More information about the vlc-commits mailing list