> Date: Thu, 8 Jun 2023 16:19:04 +0200 > CC: <bug-make@gnu.org> > From: Torbjorn SVENSSON <torbjorn.svens...@foss.st.com> > > On 2023-06-08 16:14, Eli Zaretskii wrote: > >> Date: Thu, 8 Jun 2023 14:44:35 +0200 > >> From: Torbjorn SVENSSON <torbjorn.svens...@foss.st.com> > >> > >> /build/gnu-make_4.4.1-45-g07fcee35/src/function.c: In function > >> 'windows32_openpipe': > >> /build/gnu-make_4.4.1-45-g07fcee35/src/function.c:1676:12: error: cast > >> from function call of type 'intptr_t {aka long long int}' to non-matching > >> type 'void *' [-Werror=bad-function-cast] > >> tmpErr = (HANDLE)_get_osfhandle (errfd); > >> ^ > >> > >> > >> /build/gnu-make_4.4.1-45-g07fcee35/src/job.c: In function > >> 'create_batch_file': > >> /build/gnu-make_4.4.1-45-g07fcee35/src/job.c:365:3: error: format not a > >> string literal and no format arguments [-Werror=format-security] > >> O (fatal, NILF, error_string); > >> ^ > >> > >> > >> On the MSDN page for _get_osfhandle, they recommend to case the return > >> value > >> to HANDLE, but GCC apparently thinks this is not allowed. > >> Any idea on how to get around this issue? > >> > >> > >> For the O()-macro; is it correct to use the macro with a variable? > >> Maybe it's more appropriate to fall fatal directly with the arguments? > > > > Is this with x86_64 being the target or i686? I'm guessing the > > latter, since for 64-bit Windows 'long long' and 'void *' are of the > > same width. If it's indeed for i686, are you sure the MinGW64 headers > > you have support 32-bit builds? Because AFAIR MinGW64 tossed > > supported for old Windows versions, which basically means they don't > > support 32-bit Windows. > > The idea is to have a 64-bit make application. I just included the i686 > log for completeness.
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 *'.