From f7503ca183e082ae7f591f724b92797a444efa02 Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Wed, 12 Feb 2025 14:53:34 -0800 Subject: [PATCH] libapparmor: swig: remove instance of label followed by declaration Signed-off-by: Ryan Lee (cherry picked from commit af883bb70672e468edcdb92ad05d8be7e16137c9) Signed-off-by: John Johansen --- libraries/libapparmor/swig/SWIG/libapparmor.i | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/libapparmor/swig/SWIG/libapparmor.i b/libraries/libapparmor/swig/SWIG/libapparmor.i index f31e2f60b..9c01b182b 100644 --- a/libraries/libapparmor/swig/SWIG/libapparmor.i +++ b/libraries/libapparmor/swig/SWIG/libapparmor.i @@ -258,7 +258,13 @@ extern int aa_is_enabled(void); * allocation uninitialized (0) != SWIG_NEWOBJ */ %#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L - static_assert(SWIG_NEWOBJ != 0, "SWIG_NEWOBJ is 0"); + /* + * Some older versions of SWIG place this right after a goto label + * This would then be a label followed by a declaration, a C23 extension (!) + * To ensure this works for older SWIG versions and older compilers, + * make this a block element with curly braces. + */ + {static_assert(SWIG_NEWOBJ != 0, "SWIG_NEWOBJ is 0");} %#endif if ($1 != NULL && alloc_tracking$argnum != NULL) { for (Py_ssize_t i=0; i