Skip to content
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

Failing to compile client #72

Open
Codent0101 opened this issue Dec 8, 2022 · 0 comments · May be fixed by #79
Open

Failing to compile client #72

Codent0101 opened this issue Dec 8, 2022 · 0 comments · May be fixed by #79

Comments

@Codent0101
Copy link

Hi Guys,

I am failing to compile with the following error, my version of libmicrohttpd is 0.9.75.

I have tried a fresh compile of both on a clean machine and still running into the same issue, any having a similar experience?

[ 50%] Building C object CMakeFiles/promhttp.dir/src/promhttp.c.o
/home/jamieb/prometheus-client-c/promhttp/src/promhttp.c: In function ‘promhttp_start_daemon’:
/home/jamieb/prometheus-client-c/promhttp/src/promhttp.c:64:54: error: passing argument 5 of ‘MHD_start_daemon’ from incompatible pointer type [-Werror=incompatible-pointer-types]
   64 |   return MHD_start_daemon(flags, port, apc, apc_cls, &promhttp_handler, NULL, MHD_OPTION_END);
      |                                                      ^~~~~~~~~~~~~~~~~
      |                                                      |
      |                                                      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 /home/jamieb/prometheus-client-c/promhttp/src/promhttp.c:19:
/usr/local/include/microhttpd.h:2813:1: 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 **)’}
 2813 | MHD_start_daemon (unsigned int flags,
      | ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/promhttp.dir/build.make:63: CMakeFiles/promhttp.dir/src/promhttp.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/promhttp.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
ERROR: promhttp Make Failure
wferi added a commit to wferi/prometheus-client-c that referenced this issue Apr 1, 2023
The type of MHD_YES/NO changed in libmicrohttpd 0.9.70, so flexibility
is needed for some time to avoid "incompatible pointer type" warning,
which breaks the default build where warnings are treated as errors.

Furthermore the public declaration of promhttp_handler() is useful
when the promhttpd_start_daemon() helper is not flexible enough and
thus the library user has to invoke MHD_start_daemon() directly.

Fixes digitalocean#72.
wferi added a commit to wferi/prometheus-client-c that referenced this issue Apr 3, 2023
The type of MHD_YES/NO changed in libmicrohttpd 0.9.70, so flexibility
is needed for some time to avoid "incompatible pointer type" warning,
which breaks the default build where warnings are treated as errors.

Furthermore the public declaration of promhttp_handler() is useful
when the promhttpd_start_daemon() helper is not flexible enough and
thus the library user has to invoke MHD_start_daemon() directly.

Fixes digitalocean#72.
@K1ll-9 K1ll-9 mentioned this issue Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant