openbsd-ports/databases/libdbi-drivers/patches/patch-tests_cgreen_src_constraint_c
jca 505b0a6fbd Use casts to explicitely allow conversions from intptr_t to pointers.
One could note that the C standard doesn't allow you to store a function
pointer into an intptr_t.  It seems that most people don't care.
2023-01-27 18:34:33 +00:00

17 lines
734 B
Plaintext

clang 15 doesn't allow implicit conversions from intptr_t to pointer.
Index: tests/cgreen/src/constraint.c
--- tests/cgreen/src/constraint.c.orig
+++ tests/cgreen/src/constraint.c
@@ -164,8 +164,8 @@ static void test_want_double(Constraint *constraint, c
}
static int compare_using_matcher(Constraint *constraint, intptr_t actual) {
- int (*matches)(const void*) = constraint->expected;
- return matches(actual);
+ int (*matches)(const void*) = (int (*)(const void *))constraint->expected;
+ return matches((void *)actual);
}
static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) {