-
Notifications
You must be signed in to change notification settings - Fork 1.2k
libmicrohttpd API change in 0.9.71 #3511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
pvxe
added a commit
to pvxe/collectd
that referenced
this issue
Jul 18, 2020
libmicrohttpd introduced an API change with respect its callback return types. Now its signature says that an enum must be returned instead of an int. This causes collectd to not finish compilation because of the compiler warnings this arised (in addition to -Werror) Add conditional compiling so systems with microhttpd >=0.9.71 can compile collectd with -Werror Fixes collectd#3511
@bzed good catch, yes! |
I have the same issue again? src/capabilities.c: In function ‘cap_start_daemon’:
src/capabilities.c:317:38: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
317 | flags, httpd_port, NULL, NULL, cap_http_handler, NULL,
| ^~~~~~~~~~~~~~~~
| |
| int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **) {aka int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)}
In file included from src/capabilities.c:35:
/usr/include/microhttpd.h:2428:45: note: expected ‘MHD_AccessHandlerCallback’ {aka ‘enum MHD_Result (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’} but argument is of type ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, size_t *, void **)’ {aka ‘int (*)(void *, struct MHD_Connection *, const char *, const char *, const char *, const char *, long unsigned int *, void **)’}
2428 | MHD_AccessHandlerCallback dh, void *dh_cls,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7695: src/capabilities_la-capabilities.lo] Error 1
make[1]: Leaving directory '/home/nick/Desktop/collectd'
make: *** [Makefile:5387: all] Error 2 |
frankbielig
pushed a commit
to frankbielig/collectd
that referenced
this issue
Dec 9, 2020
libmicrohttpd introduced an API change with respect its callback return types. Now its signature says that an enum must be returned instead of an int. This causes collectd to not finish compilation because of the compiler warnings this arised (in addition to -Werror) Add conditional compiling so systems with microhttpd >=0.9.71 can compile collectd with -Werror Fixes collectd#3511
frankbielig
pushed a commit
to frankbielig/collectd
that referenced
this issue
Dec 9, 2020
carlospeon
pushed a commit
to carlospeon/collectd
that referenced
this issue
Oct 17, 2022
libmicrohttpd introduced an API change with respect its callback return types. Now its signature says that an enum must be returned instead of an int. This causes collectd to not finish compilation because of the compiler warnings this arised (in addition to -Werror) Add conditional compiling so systems with microhttpd >=0.9.71 can compile collectd with -Werror Fixes collectd#3511
carlospeon
pushed a commit
to carlospeon/collectd
that referenced
this issue
Oct 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! It's seems that a breaking change in libmicrohttpd's API is making collectd unable to compile with
-Werror
Expected behavior
Successful compilation of collectd
Actual behavior
collectd cannot compile with
-Werror
and fails withThis is because an API breaking change in libmicrohttpd in version 0.9.71. The return value of callbacks is now
enum
in contrast toint
for libmicrohttpd versions <0.9.71See
Steps to reproduce
build.sh && ./configure
make
Solution
Conditionalize the return type for callback functions inside
capabilities.c
and updatecapabilities_test.c
I'll be opening a PR soon fixing this. I would appreciate any feedback whatsoever. :)
The text was updated successfully, but these errors were encountered: