Bug#964563: nageru: FTBFS: ../shared/httpd.cpp:47:25: error: invalid conversion

2020-07-09 Thread Steinar H. Gunderson
On Thu, Jul 09, 2020 at 09:41:16AM +0200, Sebastian Ramacher wrote:
> Looks like libmicrohttpd upstream didn't consider what it would mean for
> C++ users:
> https://lists.gnu.org/archive/html/libmicrohttpd/2020-07/msg00011.html

Indeed. But calling a function pointer through one of a different type is
undefined behavior even in C.

In any case, I'll need to add some #ifdefs, I believe.

/* Steinar */
-- 
Homepage: https://www.sesse.net/



Bug#964563: nageru: FTBFS: ../shared/httpd.cpp:47:25: error: invalid conversion

2020-07-09 Thread Sebastian Ramacher
On 2020-07-08 20:30:12, Steinar H. Gunderson wrote:
> On Wed, Jul 08, 2020 at 08:26:36PM +0200, Steinar H. Gunderson wrote:
> > Has libmicrohttpd changed ABI or something? I assume the size of size_t
> > hasn't changed :-)
> 
> Indeed, they broke the API:
> 
> Wed 08 Apr 2020 10:53:01 PM CEST
> Introduce `enum MHD_Result` for #MHD_YES/#MHD_NO to avoid using 'int' so 
> much.
> Note that this change WILL cause compiler warnings until (most) MHD 
> callbacks
> in application code change their return type from 'int' to 'enum 
> MHD_Result'.
> That said, avoiding possible confusions of different enums is going to 
> make
> the code more robust in the future. For conditional compilation, test
> for "MHD_VERSION >= 0x00097002". -CG
> 
> “Will cause compiler warnings”, aka errors in C++ and undefined behavior in 
> C...

Looks like libmicrohttpd upstream didn't consider what it would mean for
C++ users:
https://lists.gnu.org/archive/html/libmicrohttpd/2020-07/msg00011.html

Cheers
-- 
Sebastian Ramacher



Bug#964563: nageru: FTBFS: ../shared/httpd.cpp:47:25: error: invalid conversion

2020-07-08 Thread Steinar H. Gunderson
On Wed, Jul 08, 2020 at 08:15:01PM +0200, Sebastian Ramacher wrote:
> | ../shared/httpd.cpp:47:25: error: invalid conversion from ‘int (*)(void*, 
> MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, 
> void**)’ {aka ‘int (*)(void*, MHD_Connection*, const char*, const char*, 
> const char*, const char*, long unsigned int*, void**)’} to 
> ‘MHD_AccessHandlerCallback’ {aka ‘MHD_Result (*)(void*, MHD_Connection*, 
> const char*, const char*, const char*, const char*, long unsigned int*, 
> void**)’} [-fpermissive]
> |47 | _to_connection_thunk, this,
> |   | ^~~
> |   | |
> |   | int (*)(void*, MHD_Connection*, const 
> char*, const char*, const char*, const char*, size_t*, void**) {aka int 
> (*)(void*, MHD_Connection*, const char*, const char*, const char*, const 
> char*, long unsigned int*, void**)}

Has libmicrohttpd changed ABI or something? I assume the size of size_t
hasn't changed :-)

/* Steinar */
-- 
Homepage: https://www.sesse.net/



Bug#964563: nageru: FTBFS: ../shared/httpd.cpp:47:25: error: invalid conversion

2020-07-08 Thread Steinar H. Gunderson
On Wed, Jul 08, 2020 at 08:26:36PM +0200, Steinar H. Gunderson wrote:
> Has libmicrohttpd changed ABI or something? I assume the size of size_t
> hasn't changed :-)

Indeed, they broke the API:

Wed 08 Apr 2020 10:53:01 PM CEST
Introduce `enum MHD_Result` for #MHD_YES/#MHD_NO to avoid using 'int' so 
much.
Note that this change WILL cause compiler warnings until (most) MHD 
callbacks
in application code change their return type from 'int' to 'enum 
MHD_Result'.
That said, avoiding possible confusions of different enums is going to make
the code more robust in the future. For conditional compilation, test
for "MHD_VERSION >= 0x00097002". -CG

“Will cause compiler warnings”, aka errors in C++ and undefined behavior in C...

/* Steinar */
-- 
Homepage: https://www.sesse.net/



Bug#964563: nageru: FTBFS: ../shared/httpd.cpp:47:25: error: invalid conversion

2020-07-08 Thread Sebastian Ramacher
Source: nageru
Version: 2.0.0-3
Severity: serious
Tags: ftbfs sid bullseye
Justification: fails to build from source (but built successfully in the past)

nageru currently fails to build:
| FAILED: shared/a4d2686@@shared@sta/httpd.cpp.o 
| c++ -Ishared/a4d2686@@shared@sta -Ishared -I../shared -I. -I.. 
-I/usr/include/x86_64-linux-gnu/qt5/QtOpenGL 
-I/usr/include/x86_64-linux-gnu/qt5/QtWidgets 
-I/usr/include/x86_64-linux-gnu/qt5/QtGui 
-I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5 
-I/usr/include/p11-kit-1 -I/usr/include/movit -I/usr/include/eigen3 
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 
'-DMOVIT_SHADER_DIR="/usr/share/movit"' '-DNAGERU_VERSION="2.0.0"' 
'-DPREFIX="/usr"' -DHAVE_SRT=1 -g -O2 -fdebug-prefix-map=/<>=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2 -fPIC -pthread -DQT_OPENGL_LIB -DQT_WIDGETS_LIB 
-DQT_GUI_LIB -DQT_CORE_LIB -MD -MQ 'shared/a4d2686@@shared@sta/httpd.cpp.o' -MF 
'shared/a4d2686@@shared@sta/httpd.cpp.o.d' -o 
'shared/a4d2686@@shared@sta/httpd.cpp.o' -c ../shared/httpd.cpp
| ../shared/httpd.cpp: In member function ‘void HTTPD::start(int)’:
| ../shared/httpd.cpp:47:25: error: invalid conversion from ‘int (*)(void*, 
MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, 
void**)’ {aka ‘int (*)(void*, MHD_Connection*, const char*, const char*, const 
char*, const char*, long unsigned int*, void**)’} to 
‘MHD_AccessHandlerCallback’ {aka ‘MHD_Result (*)(void*, MHD_Connection*, const 
char*, const char*, const char*, const char*, long unsigned int*, void**)’} 
[-fpermissive]
|47 | _to_connection_thunk, this,
|   | ^~~
|   | |
|   | int (*)(void*, MHD_Connection*, const char*, 
const char*, const char*, const char*, size_t*, void**) {aka int (*)(void*, 
MHD_Connection*, const char*, const char*, const char*, const char*, long 
unsigned int*, void**)}
| In file included from ../shared/httpd.cpp:7:
| /usr/include/microhttpd.h:2428:45: note:   initializing argument 5 of 
‘MHD_Daemon* MHD_start_daemon(unsigned int, uint16_t, MHD_AcceptPolicyCallback, 
void*, MHD_AccessHandlerCallback, void*, ...)’
|  2428 |   MHD_AccessHandlerCallback dh, void *dh_cls,
|   |   ~~^~

See
https://buildd.debian.org/status/fetch.php?pkg=nageru=amd64=2.0.0-3%2Bb1=1594190360=0

Cheers
-- 
Sebastian Ramacher


signature.asc
Description: PGP signature