I am trying to write a function to compare two arrays of pointers to see if they I would like to use functions on any array of signals, that is what the indicators indicate - I am only interested in the similarity of the indicator.
I have written it: My unit test looks like this: But when I compile, I get the following warnings (not errors): The compiler is complaining that the type I am using in my unit-test does not match the function prototype but I'm not really interested Has the underlying type, only the pointer to it. Required for your function (an indicator of the first element) / Code>. You are trying to pass it to an array of This is not allowed in C, because (among other reasons) it is not even guaranteed from the C standard that In relation to implementation-specific specifications, which they are very much in implementation, you can use
zero testPTR_ARRAY_EQ (zero) {mode * m1, * m2, * m3, * M4, * M5, * M6; Mode * A [] = {M1, M2, M3, M4, M5}; Mode * b [] = {m1, m2, m3, m4, m5}; Mode * c [] = {m2, m3, m4, m5, m6}; Mode * d [] = {m1, m3, m4, m5, m6}; CU_ASSERT (ptr_array_eq (a, a, 4)); CU_ASSERT (ptr_array_eq (a, b, 4)); CU_ASSERT (! Ptr_array_eq (a, c, 4)); CU_ASSERT (! Ptr_array_eq (a, d, 4)); }
test_utility.c: "testPTR_ARRAY_EQ?" ??: test_utility.c: 648: 5: WARNING: 1 argument of passing ??? Ptr_array_eqâ ???? Inconsistent indicator type [enabled by default] ./src/glamdring2.h:327:6: Note: Expected "Cant Align" ** But there is a type of logic type; Structure mode ** one ????
const zero *
mode * (an indicator of the first element).
zero * and
mode * If there are similar shapes, language does not mistakenly treat such programs as an array, as if it is an array of others.
memcmp to compare arrays.
Comments
Post a Comment