aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSören Tempel <soeren+github@soeren-tempel.net>2025-02-17 23:43:48 +0100
committerGitHub <noreply@github.com>2025-02-18 06:43:48 +0800
commit639734bed4efc9b17082886512442f1e89408a73 (patch)
tree46266c625a31bd905c7ee335d77353d4c03ff911
parent1827ab7a1f9a0232e0824f91210ca09f7667c828 (diff)
downloadrneovim-639734bed4efc9b17082886512442f1e89408a73.tar.gz
rneovim-639734bed4efc9b17082886512442f1e89408a73.tar.bz2
rneovim-639734bed4efc9b17082886512442f1e89408a73.zip
fix(tests): remove the __extension__ keyword in filter_complex_blocks (#32483)
Problem: This keyword is used by GCC and Clang to prevent -Wpedantic (and other options) from emitting warnings for many GNU C extensions. This is used heavily in Alpine Linux through musl libc and foritfy-headers. Without filtering the __extension__ keyword some type definitions are duplicated. For example, timeval is defined once as struct timeval { time_t tv_sec; suseconds_t tv_usec; }; and once as: __extension__ struct timeval { time_t tv_sec; suseconds_t tv_usec; }; Without this patch, the LuaJIT C parser doesn't recognize that these definitions are equivalent, causing unit test to fail on Alpine Linux. Solution: Filter out the keyword in filter_complex_blocks.
-rw-r--r--test/unit/testutil.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/unit/testutil.lua b/test/unit/testutil.lua
index 4720d4d730..7fe27ad735 100644
--- a/test/unit/testutil.lua
+++ b/test/unit/testutil.lua
@@ -151,6 +151,9 @@ local function filter_complex_blocks(body)
or string.find(line, 'mach_vm_range_recipe')
)
then
+ -- Remove GCC's extension keyword which is just used to disable warnings.
+ line = string.gsub(line, '__extension__', '')
+
-- HACK: remove bitfields from specific structs as luajit can't seem to handle them.
if line:find('struct VTermState') then
line = string.gsub(line, 'state : 8;', 'state;')