libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] libmicrohttpd api change?


From: Christian Grothoff
Subject: Re: [libmicrohttpd] libmicrohttpd api change?
Date: Wed, 8 Jul 2020 15:33:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

Please see the 0.9.71 release announcement:

https://lists.gnu.org/archive/html/libmicrohttpd/2020-06/msg00013.html

Furthermore, the release introduces an 'enum MHD_Result' instead of
#defines for MHD_YES/MHD_NO. This is intended to make it easier to check
for certain API misuse bugs by providing better types (not everything is
an 'int').  While this does NOT change the binary API, this change
_will_ cause compiler warnings for all legacy code -- until 'int' is
replaced with 'enum MHD_Result'.

If you want your code to build without warnings on both older and newer
MHD releases, you may want to introduce a MHD_RESULT as done here:

https://git.gnunet.org/gnunet.git/tree/src/include/gnunet_mhd_compat.h

That said, this being a security release it may be a good time to not
build nicely against older versions.


On 7/8/20 10:57 AM, Michael Vetter wrote:
> Hello!
> 
> For our project Profanity [1] (an XMPP client) we have a test framework
> called stabber [2].
> 
> Stabber uses libmicrohttpd.
> 
> Our CI show [3] now that stabber doesn't build anymore on Debian
> Testing, Arch Linux and Fedora.
> 
> It appears on Debian testing libmicrohttpd was updated to 0.9.71.
> While on Debian stable (where stabber builds) 0.9.62 is used.
> 
> Is it possible that you did an API change in a minor release?
> We get the following build failure:
> https://travis-ci.org/github/profanity-im/profanity/jobs/705760514#L2123
> 
> ```
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./src
> -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> -Wall -Wno-deprecated-declarations -Wunused -Werror -g -O2 -c
> src/server/httpapi.c  -fPIC -DPIC -o src/server/.libs/httpapi.o
> 
> src/server/httpapi.c: In function 'httpapi_start':
> 
> src/server/httpapi.c:195:9: error: passing argument 5 of
> 'MHD_start_daemon' from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> 
>   195 |         &connection_cb,
> 
>       |         ^~~~~~~~~~~~~~
> 
>       |         |
> 
>       |         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/server/httpapi.c:36:
> 
> /usr/include/microhttpd.h:2425: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 **)'}
> 
>  2425 | MHD_start_daemon (unsigned int flags,
> 
>       | ^~~~~~~~~~~~~~~~
> 
> cc1: all warnings being treated as errors
> ```
> 
> 1: https://github.com/profanity-im/profanity
> 2: https://github.com/profanity-im/stabber
> 3: https://travis-ci.org/github/profanity-im/profanity/builds/705760512
> 
> Best,
> Michael
> 
> PS: Please include me in CC since I'm not subscribed to the mailinglist.
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]