Improve support for marshalling of two arrays that share a length parameter
Inspired by this discussion, we have a marshalling test in the gobject-introspection test suite that tests a function signature where two arrays are passed in, along with a length parameter that is the length of both arrays:
/** * gi_marshalling_tests_multi_array_key_value_in: * @keys: (array length=length): * @values: (array length=length): */ void gi_marshalling_tests_multi_array_key_value_in (int length, const char** keys, const GValue* values);
const keys = ['one', 'two', 'three']; const values = [1, 2, 3]; GIMarshallingTests.multi_array_key_value_in(keys, values);
However, a warning is logged:
Too many arguments to function GIMarshallingTests.multi_array_key_value_in: expected 1, got 2
This warning is obviously incorrect, as the test function verifies that the second array is passed into the function with the correct contents. So it's likely a problem in the code that counts the arguments of C functions. The test suite should pass without this warning.