mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	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.
			
			
This commit is contained in:
		@@ -151,6 +151,9 @@ local function filter_complex_blocks(body)
 | 
				
			|||||||
        or string.find(line, 'mach_vm_range_recipe')
 | 
					        or string.find(line, 'mach_vm_range_recipe')
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    then
 | 
					    then
 | 
				
			||||||
 | 
					      -- Remove GCC's extension keyword which is just used to disable warnings.
 | 
				
			||||||
 | 
					      line = string.gsub(line, '__extension__', '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      result[#result + 1] = line
 | 
					      result[#result + 1] = line
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user