Make PostgreSQL work with newer libxml2.

Поиск
Список
Период
Сортировка
От Xing Guo
Тема Make PostgreSQL work with newer libxml2.
Дата
Msg-id CACpMh+DMZVHM+iDSyqdcpK8sr7jd_HxxLJRNvGTzcLBE0W07QA@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi hackers,

There is a breaking change of API since the v2.12.0 of libxml2[1][2]. My compiler complains about incompatible function signatures:


/usr/bin/clang -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing
-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compou
nd-token-split-by-macro -Wno-cast-function-type-strict -g -Og -g3 -I. -I. -I../../../../src/include  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o xml.o xml.c
xml.c:1199:45: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type '
xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
        xmlSetStructuredErrorFunc((void *) errcxt, xml_errorHandler);
                                                   ^~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/xmlerror.h:898:29: note: passing argument to parameter 'handler' here
                                 xmlStructuredErrorFunc handler);
                                                        ^
xml.c:4806:55: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type '
xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
        xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);
                                                             ^~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/xmlerror.h:898:29: note: passing argument to parameter 'handler' here
                                 xmlStructuredErrorFunc handler);
                                                        ^
xml.c:4860:55: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type '
xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
        xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);
                                                             ^~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/xmlerror.h:898:29: note: passing argument to parameter 'handler' here
                                 xmlStructuredErrorFunc handler);
                                                        ^
xml.c:5003:55: error: incompatible function pointer types passing 'void (void *, xmlErrorPtr)' (aka 'void (void *, struct _xmlError *)') to parameter of type '
xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
        xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler);
                                                             ^~~~~~~~~~~~~~~~
/usr/include/libxml2/libxml/xmlerror.h:898:29: note: passing argument to parameter 'handler' here
                                 xmlStructuredErrorFunc handler);
                                                        ^
4 errors generated.
make[4]: *** [<builtin>: xml.o] Error 1


Here is a quick workaround for it.


Best Regards,
Xing






Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Emitting JSON to file using COPY TO
Следующее
От: Davin Shearer
Дата:
Сообщение: Re: Emitting JSON to file using COPY TO