On 4/11/19 7:26 PM, Bruno Haible wrote: > Btw, I never build with mingw-pthreads installed. But even with mingw-pthreads > installed, gnulib modules ought to not use it; they ought to use the Windows > API instead. Jumping in late, but this reminded me of a patch I wrote years ago: https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=c91d13bd > On my Fedora 20 box with mingw cross-compiler, the build failed with: > > ../../src/rpc/virnetclient.c: In function 'virNetClientSetTLSSession': > ../../src/rpc/virnetclient.c:745:14: error: unused variable 'oldmask' [-Werror=unused-variable] > sigset_t oldmask, blockedsigs; > ^ > > I traced it to the fact that mingw64-winpthreads installs a header > that does #define pthread_sigmask(...) 0, which means any argument > only ever passed to pthread_sigmask is reported as unused. This > patch works around the compilation failure, with behavior no worse > than what mingw already gives us regarding the function being a > no-op. > > * configure.ac (pthread_sigmask): Probe for broken mingw macro. > * src/util/virutil.h (pthread_sigmask): Rewrite to something that > avoids unused variables. Here we are 5 years later, and mingw32-winpthreads-5.0.4-2.fd29 still has a broken: /usr/i686-w64-mingw32/sys-root/mingw/include/pthread_signal.h: #define pthread_sigmask(H, S1, S2) 0 So indeed, gnulib could do a better job at avoiding that library as more pain than it is worth. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org