Hi folks,

I was building libxcb a little while ago and noticed some errors from GCC that seemed to be related to API changes in Check. I found a pull request upstream (https://gitlab.freedesktop.org/xorg/lib/libxcb/merge_requests/6/diffs?commit_id=a667ec3e0cf5d9cd1d1715e3fff3328e353fae84) that contained a fix for this. Here are some of the errors - note that there are lots of repititons of the same line:

check_public.c:216:20: error: passing argument 2 of ‘suite_add_test’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  216 |  suite_add_test(s, popcount, "xcb_popcount");
      |                    ^~~~~~~~
      |                    |
      |                    const TTest * {aka const struct TTest *}
In file included from check_public.c:4:
check_suites.h:3:36: note: expected ‘TFun’ {aka ‘void (*)(int)’} but argument is of type ‘const TTest *’ {aka ‘const struct TTest *’}
    3 | void suite_add_test(Suite *s, TFun tf, const char *name);
      |                               ~~~~~^~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:666: check_public.o] Error 1
make[3]: Target 'check_all' not remade because of errors.
make[3]: Leaving directory '/sources/libxcb-1.13.1/tests'
make[2]: *** [Makefile:1014: check-am] Error 2
make[2]: Leaving directory '/sources/libxcb-1.13.1/tests'
make[1]: *** [Makefile:699: check-recursive] Error 1
make[1]: Leaving directory '/sources/libxcb-1.13.1/tests'
make: *** [Makefile:792: check-recursive] Error 1

I've crafted a couple of seds for this, that allowed the tests to pass:

sed -i "s/TFun tf/const TTest *tt/" tests/check_all.c tests/check_suites.h

sed -i "s/tcase_add_test(tc, tf);/tcase_add_test(tc, tt);/" tests/check_all.c

Are there any objections to me adding these into the book?

Thank you,

- Doug

--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to