On Thu, 2023-06-08 at 20:39 +0200, Torbjorn SVENSSON wrote: > > If you get the error about casting _get_osfhandle to HANDLE only > > for the 32-bit build, and you don't care about that build, then > > just ignore it. But if that error is emitted for the 64-bit build, > > then there's something strange here, since on 64-bit Windows 'long > > long' should be compatible with 'void *'. > > The error is emitted in both builds, but let's ignore 32-bit for now. > Both the errors that I pasted above are emitted using > x86_64-w64-mingw32 and need to have some kind of fix to have a > successful build. > > Any idea what could be done except disabling the warning for the > cast.
I have no comment on how to successfully cross-compile for Windows. However I will say that as a general policy GNU programs never enable -Werror for our published packages, because different compilers, and different versions of compilers, generate different warnings and there's no way we can know what they will be, when we release the software. We enable -Werror for our internal development builds ("maintainer builds" in GNU Make) and we fix all warnings there. I personally recommend you do the same (don't enable -Werror, unless you're creating a developer build of GNU Make). But if you're committed to finding a way to fix this warning that's fine too!