bug-gnulib
[Top][All Lists]
Advanced

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

Re: mingw and execute vs. posix_spawn


From: Bruno Haible
Subject: Re: mingw and execute vs. posix_spawn
Date: Fri, 6 Mar 2009 15:53:25 +0100
User-agent: KMail/1.9.9

Eric Blake wrote:
> @@ -44,7 +44,7 @@ dup_noinherit (int fd)
>                       (DWORD) 0,                  /* DesiredAccess */
>                       FALSE,                      /* InheritHandle */
>                       DUPLICATE_SAME_ACCESS))     /* Options */
> -    error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 
> 0x%08x"),
> +    error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 
> 0x%08lx"),
>          GetLastError ());

DWORD is uint32_t. Whether 'long' is also uint32_t on all Windows ABIs, is not
clear to me. When I see patches like [1], I get confused. So better avoid the
warning using riskless code:
[1] http://www.winehq.org/pipermail/wine-patches/2006-November/032672.html


2009-03-06  Bruno Haible  <address@hidden>

        * lib/w32spawn.h (dup_noinherit): Add cast, to avoid gcc warning.
        Reported by Eric Blake.

--- lib/w32spawn.h.orig 2009-03-06 15:52:09.000000000 +0100
+++ lib/w32spawn.h      2009-03-06 15:50:26.000000000 +0100
@@ -1,5 +1,5 @@
 /* Auxiliary functions for the creation of subprocesses.  Native Woe32 API.
-   Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
    Written by Bruno Haible <address@hidden>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -45,7 +45,7 @@
                        FALSE,                      /* InheritHandle */
                        DUPLICATE_SAME_ACCESS))     /* Options */
     error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 0x%08x"),
-          GetLastError ());
+          (unsigned int) GetLastError ());
 
   nfd = _open_osfhandle ((long) new_handle, O_BINARY);
   if (nfd < 0)





reply via email to

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