PR #23831 opened by Martin Storsjö (mstorsjo)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23831
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23831.patch

Older versions of Clang (17 and older) errored out on the previous
form like this:

    ./src/tests/checkasm/sw_ops.c:210:9: error: expected expression
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), 
"palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^

While newer versions of Clang merely warned about it:

    ./src/tests/checkasm/sw_ops.c:210:9: warning: label followed by a 
declaration is a C23 extension [-Wc23-extensions]
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), 
"palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^




From 0fd6b796b80cf08affda86dea9fdfd40089a988e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <[email protected]>
Date: Thu, 16 Jul 2026 15:18:33 +0300
Subject: [PATCH] checkasm: sw_ops: Fix building with older versions of Clang

Older versions of Clang (17 and older) errored out on the previous
form like this:

    ./src/tests/checkasm/sw_ops.c:210:9: error: expected expression
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), 
"palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^

While newer versions of Clang merely warned about it:

    ./src/tests/checkasm/sw_ops.c:210:9: warning: label followed by a 
declaration is a C23 extension [-Wc23-extensions]
      210 |         static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), 
"palette plane too small");
          |         ^
    /usr/include/assert.h:158:24: note: expanded from macro 'static_assert'
      158 | # define static_assert _Static_assert
          |                        ^
---
 tests/checkasm/sw_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/sw_ops.c b/tests/checkasm/sw_ops.c
index e6c28062ed..df81caf469 100644
--- a/tests/checkasm/sw_ops.c
+++ b/tests/checkasm/sw_ops.c
@@ -207,8 +207,8 @@ static void check_compiled(const Test *test,
     const SwsUOp *read_op = &test->uops[0];
     switch (read_op->uop) {
     case SWS_UOP_READ_PALETTE:
-        static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), "palette plane 
too small");
         exec.in_bump[1] = exec.in_stride[1] = 0;
+        static_assert(sizeof(src0[1]) >= sizeof(uint32_t[256]), "palette plane 
too small");
         break;
     case SWS_UOP_READ_PLANAR_FV: {
         const int *offsets = read_op->data.kernel->offsets;
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to