diff mbox series

guest agent: Fixes for windows guest agent building on msys2/mingw

Message ID 20200915163343.1100-1-luoyonggang@gmail.com
State New
Headers show
Series guest agent: Fixes for windows guest agent building on msys2/mingw | expand

Commit Message

罗勇刚(Yonggang Luo) Sept. 15, 2020, 4:33 p.m. UTC
error message:
"cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include" "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0" "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
   62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../qga/commands-win32.c:26:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
  840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)

This error comes from qemu configure didn't add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS,
and these too macro are standard config for win32 if using windows wide api.

in cfgmgr32.h
  CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
#ifdef UNICODE
#define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
#endif

macro CM_Get_DevNode_Property defined only when UNICODE are defined.
and in win32, UNICODE and _UNICODE should be defined at the same time

#endif

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

Comments

Philippe Mathieu-Daudé Sept. 15, 2020, 4:41 p.m. UTC | #1
On 9/15/20 6:33 PM, Yonggang Luo wrote:
> error message:

> "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include" "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0" "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP

> ../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]

>    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

>       |                        ^~~~~~~~~~~~~~~~~~~~~~~~

> In file included from ../qga/commands-win32.c:26:

> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here

>   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);

>       |                          ^~~~~~~~~~~~~~~~~~~~~~~~

> cc1.exe: all warnings being treated as errors

> make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)

> 

> This error comes from qemu configure didn't add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS,

> and these too macro are standard config for win32 if using windows wide api.

> 

> in cfgmgr32.h

>   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);

> #ifdef UNICODE

> #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW

> #endif

> 

> macro CM_Get_DevNode_Property defined only when UNICODE are defined.

> and in win32, UNICODE and _UNICODE should be defined at the same time

> 

> #endif

> 

> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>

> ---

>  configure | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/configure b/configure

> index 9f141891ea..f5d661af4a 100755

> --- a/configure

> +++ b/configure

> @@ -812,6 +812,7 @@ MINGW32*)

>    mingw32="yes"

>    hax="yes"

>    whpx=""

> +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"


What about declaring them in include/qemu/osdep.h
instead?

-- >8 --
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 412962d91a2..cd5cedc0b21 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -74,6 +74,12 @@ extern int daemon(int, int);
 /* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
 #ifdef __MINGW32__
 #define __USE_MINGW_ANSI_STDIO 1
+#ifndef UNICODE
+#define UNICODE
+#endif
+#ifndef _UNICODE
+#define _UNICODE
+#endif
 #endif

 #include <stdarg.h>
---

>    vhost_user="no"

>    audio_possible_drivers="dsound sdl"

>    if check_include dsound.h; then

>
罗勇刚(Yonggang Luo) Sept. 15, 2020, 5:41 p.m. UTC | #2
On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:
>

> On 9/15/20 6:33 PM, Yonggang Luo wrote:

> > error message:

> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi" "-Itrace"

"-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
"-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
"-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
"-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
"-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64"
"-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef"
"-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing"
"-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition"
"-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self"
"-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels"
"-Wexpansion-to-defined" "-Wno-missing-include-dirs"
"-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong"
"-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote"
"/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote"
"/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl"
"-pthread" "-mms-bitfields" -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj
-MF "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of

'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(

> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~

> > In file included from ../qga/commands-win32.c:26:

> >

C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST

dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~

> > cc1.exe: all warnings being treated as errors

> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1

(已忽略)
> >

> > This error comes from qemu configure didn't add predefined macro

-DUNICODE -D_UNICODE in QEMU_CFLAGS,
> > and these too macro are standard config for win32 if using windows wide

api.
> >

> > in cfgmgr32.h

> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,

const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> > #ifdef UNICODE

> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW

> > #endif

> >

> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.

> > and in win32, UNICODE and _UNICODE should be defined at the same time

> >

> > #endif

> >

> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>

> > ---

> >  configure | 1 +

> >  1 file changed, 1 insertion(+)

> >

> > diff --git a/configure b/configure

> > index 9f141891ea..f5d661af4a 100755

> > --- a/configure

> > +++ b/configure

> > @@ -812,6 +812,7 @@ MINGW32*)

> >    mingw32="yes"

> >    hax="yes"

> >    whpx=""

> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"

>

> What about declaring them in include/qemu/osdep.h

> instead?

That's a good idea.
But more compiling error warns me that the windows version of qemu are not
in a good situation.
On Win32, all API should call the wide version so that support for Unicode
properly.
But obviously the currently qemu didn't do that

```

Compiling C object qga/qemu-ga.exe.p/commands-win32.c.obj
In file included from ../util/qemu-sockets.c:27:
../util/qemu-sockets.c: In function 'inet_listen_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:274:9: note: in expansion of macro 'error_setg'
  274 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'inet_parse_connect_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:429:9: note: in expansion of macro 'error_setg'
  429 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'inet_dgram_saddr':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:518:9: note: in expansion of macro 'error_setg'
  518 |         error_setg(errp, "address resolution failed for %s:%s: %s",
addr, port,
      |         ^~~~~~~~~~
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:544:9: note: in expansion of macro 'error_setg'
  544 |         error_setg(errp, "address resolution failed for %s:%s: %s",
addr, port,
      |         ^~~~~~~~~~
../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 6 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
 1235 |         error_setg(errp, "Cannot format numeric socket address: %s",
      |         ^~~~~~~~~~
In file included from ../io/dns-resolver.c:26:
../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 8 has type 'WCHAR *' {aka 'short
unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
   93 |         error_setg(errp, "address resolution failed for %s:%s: %s",
      |         ^~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误 1
(已忽略)
Linking static target io/libio.fa
C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj: No
such file or directory
make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
../net/tap-win32.c: In function 'is_tap_win32_dev':
../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
   62 | #define ADAPTER_KEY
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     const char *
../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
   62 | #define ADAPTER_KEY
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  229 |             enum_name,
      |             ^~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
      |
~~~~~~~^~~~~~
../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  247 |             unit_string,
      |             ^~~~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:258:17: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  258 |                 component_id_string,
      |                 ^~~~~~~~~~~~~~~~~~~
      |                 |
      |                 char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c:268:21: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  268 |                     net_cfg_instance_id_string,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     |
      |                     char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c: In function 'get_device_guid':
../net/tap-win32.c:64:33: error: passing argument 2 of 'RegOpenKeyExW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
   64 | #define NETWORK_CONNECTIONS_KEY
"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char *
../net/tap-win32.c:64:33: note: in definition of macro
'NETWORK_CONNECTIONS_KEY'
   64 | #define NETWORK_CONNECTIONS_KEY
"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:328:13: error: passing argument 3 of 'RegEnumKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  328 |             enum_name,
      |             ^~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
      |
~~~~~~~^~~~~~
../net/tap-win32.c:348:13: error: passing argument 2 of 'RegOpenKeyExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  348 |             connection_string,
      |             ^~~~~~~~~~~~~~~~~
      |             |
      |             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
      |                                                 ~~~~~~~~^~~~~~~~
../net/tap-win32.c:357:17: error: passing argument 2 of 'RegQueryValueExW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  357 |                 name_string,
      |                 ^~~~~~~~~~~
      |                 |
      |                 const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR
lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD
lpcbData);
      |
 ~~~~~~~~^~~~~~~~~~~
../net/tap-win32.c: In function 'tap_win32_open':
../net/tap-win32.c:626:9: error: passing argument 1 of 'CreateFileW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  626 |         device_path,
      |         ^~~~~~~~~~~
      |         |
      |         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../net/tap-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../chardev/char-win.c: In function 'win_chr_serial_init':
../chardev/char-win.c:96:26: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   96 |     s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0,
NULL,
      |                          ^~~~~~~~
      |                          |
      |                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../chardev/char-win.c:111:26: error: passing argument 1 of
'GetDefaultCommConfigW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  111 |     GetDefaultCommConfig(filename, &comcfg, &size);
      |                          ^~~~~~~~
      |                          |
      |                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2394:60:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2394 |   WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigW (LPCWSTR
lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
      |                                                    ~~~~~~~~^~~~~~~~
../chardev/char-win.c:113:22: error: passing argument 1 of
'CommConfigDialogW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  113 |     CommConfigDialog(filename, NULL, &comcfg);
      |                      ^~~~~~~~
      |                      |
      |                      const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-win.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2392:56:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2392 |   WINBASEAPI WINBOOL WINAPI CommConfigDialogW (LPCWSTR lpszName,
HWND hWnd, LPCOMMCONFIG lpCC);
      |                                                ~~~~~~~~^~~~~~~~
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
../chardev/char-file.c: In function 'qmp_chardev_open_file':
../chardev/char-file.c:63:26: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   63 |     out = CreateFile(file->out, accessmode, FILE_SHARE_READ, NULL,
flags,
      |                      ~~~~^~~~~
      |                          |
      |                          char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-file.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../block.c: In function 'get_tmp_filename':
../block.c:757:35: error: passing argument 2 of 'GetTempPathW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  757 |     return (GetTempPath(MAX_PATH, temp_dir)
      |                                   ^~~~~~~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:188:69:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  188 |   WINBASEAPI DWORD WINAPI GetTempPathW (DWORD nBufferLength, LPWSTR
lpBuffer);
      |
 ~~~~~~~^~~~~~~~
../block.c:758:32: error: passing argument 1 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                ^~~~~~~~
      |                                |
      |                                char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:52:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |                                            ~~~~~~~~^~~~~~~~~~
../block.c:758:42: error: passing argument 2 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                          ^~~~~
      |                                          |
      |                                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:72:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |
 ~~~~~~~~^~~~~~~~~~~~~~
../block.c:758:52: error: passing argument 4 of 'GetTempFileNameW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  758 |             && GetTempFileName(temp_dir, "qem", 0, filename)
      |                                                    ^~~~~~~~
      |                                                    |
      |                                                    char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:109:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName,
LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
      |
                                 ~~~~~~~^~~~~~~~~~~~~~
../chardev/char-pipe.c: In function 'win_chr_pipe_init':
../chardev/char-pipe.c:66:31: error: passing argument 1 of
'CreateNamedPipeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   66 |     s->file = CreateNamedPipe(openname,
      |                               ^~~~~~~~
      |                               |
      |                               char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:26,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../chardev/char-pipe.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h:28:54:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   28 |   WINBASEAPI HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD
dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize,
DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES
lpSecurityAttributes);
      |                                              ~~~~~~~~^~~~~~
../qga/service-win32.c: In function 'printf_win_error':
../qga/service-win32.c:28:9: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   28 |         (char *)&message, 0,
      |         ^~~~~~~~~~~~~~~~
      |         |
      |         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
../qga/service-win32.c: In function 'ga_install_service':
../qga/service-win32.c:107:34: error: initialization of 'WCHAR *' {aka
'short unsigned int *'} from incompatible pointer type 'char *'
[-Werror=incompatible-pointer-types]
  107 |     SERVICE_DESCRIPTION desc = { (char *)QGA_SERVICE_DESCRIPTION };
      |                                  ^
../qga/service-win32.c:107:34: note: (near initialization for
'desc.lpDescription')
../qga/service-win32.c:118:43: error: passing argument 1 of
'win_escape_arg' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  118 |                            win_escape_arg(module_fname, esc));
      |                                           ^~~~~~~~~~~~
      |                                           |
      |                                           TCHAR * {aka short
unsigned int *}
../qga/service-win32.c:42:47: note: expected 'const char *' but argument is
of type 'TCHAR *' {aka 'short unsigned int *'}
   42 | static const char *win_escape_arg(const char *to_escape, GString
*buffer)
      |                                   ~~~~~~~~~~~~^~~~~~~~~
In file included from ../qga/service-win32.c:15:
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:140:38: note: in expansion of macro
'QGA_SERVICE_NAME'
  140 |     service = CreateService(manager, QGA_SERVICE_NAME,
QGA_SERVICE_DISPLAY_NAME,
      |                                      ^~~~~~~~~~~~~~~~
make: [Makefile.ninja:767:chardev/libchardev.fa.p/char-win.c.obj] 错误 1 (已忽略)
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:74:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |
 ~~~~~~~~^~~~~~~~~~~~~
In file included from ../qga/service-win32.c:15:
C:/work/xemu/qemu/qga/service-win32.h:19:34: error: passing argument 3 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   19 | #define QGA_SERVICE_DISPLAY_NAME "QEMU Guest Agent"
      |                                  ^~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:140:56: note: in expansion of macro
'QGA_SERVICE_DISPLAY_NAME'
  140 |     service = CreateService(manager, QGA_SERVICE_NAME,
QGA_SERVICE_DISPLAY_NAME,
      |
 ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:96:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |
                   ~~~~~~~~^~~~~~~~~~~~~
../qga/service-win32.c:142:38: error: passing argument 8 of
'CreateServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  142 |         SERVICE_ERROR_NORMAL, cmdline->str, NULL, NULL, NULL, NULL,
NULL);
      |                               ~~~~~~~^~~~~
      |                                      |
      |                                      gchar * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:199:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'gchar *' {aka 'char *'}
  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD
dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD
dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD
lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR
lpPassword);
      |

                                              ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from ../qga/service-win32.c:15:
../qga/service-win32.c: In function 'ga_uninstall_service':
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of
'OpenServiceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/service-win32.c:173:36: note: in expansion of macro
'QGA_SERVICE_NAME'
  173 |     service = OpenService(manager, QGA_SERVICE_NAME, DELETE);
      |                                    ^~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/service-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:306:72:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  306 |   WINADVAPI SC_HANDLE WINAPI OpenServiceW(SC_HANDLE
hSCManager,LPCWSTR lpServiceName,DWORD dwDesiredAccess);
      |
 ~~~~~~~~^~~~~~~~~~~~~
../qga/channel-win32.c: In function 'ga_channel_open':
../qga/channel-win32.c:301:28: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  301 |     c->handle = CreateFile(newpath, GENERIC_READ | GENERIC_WRITE,
0, NULL,
      |                            ^~~~~~~
      |                            |
      |                            gchar * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/channel-win32.c:1:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'gchar *' {aka 'char *'}
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
make: [Makefile.ninja:952:libcommon.fa.p/net_tap-win32.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:773:chardev/libchardev.fa.p/char-file.c.obj] 错误 1
(已忽略)
../block/file-win32.c: In function 'raw_probe_alignment':
../block/file-win32.c:250:27: error: passing argument 1 of
'GetDiskFreeSpaceW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  250 |         GetDiskFreeSpace(s->drive_path, &sectorsPerCluster,
      |                          ~^~~~~~~~~~~~
      |                           |
      |                           char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:74:56:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   74 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceW (LPCWSTR
lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
      |
 ~~~~~~~~^~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
../block/file-win32.c: In function 'raw_open':
../block/file-win32.c:390:39: error: passing argument 2 of
'GetCurrentDirectoryW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  390 |         GetCurrentDirectory(MAX_PATH, buf);
      |                                       ^~~
      |                                       |
      |                                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:28,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/processenv.h:23:77:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   23 |   WINBASEAPI DWORD WINAPI GetCurrentDirectoryW (DWORD
nBufferLength, LPWSTR lpBuffer);
      |
 ~~~~~~~^~~~~~~~
../block/file-win32.c:394:27: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  394 |     s->hfile = CreateFile(filename, access_flags,
      |                           ^~~~~~~~
      |                           |
      |                           const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../block/file-win32.c: In function 'raw_getlength':
../block/file-win32.c:540:34: error: passing argument 1 of
'GetDiskFreeSpaceExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  540 |         if (!GetDiskFreeSpaceEx(s->drive_path, &available, &total,
&total_free))
      |                                 ~^~~~~~~~~~~~
      |                                  |
      |                                  char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR
lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER
lpTotalNumberOfFreeBytes);
      |
 ~~~~~~~~^~~~~~~~~~~~~~~
make: [Makefile.ninja:1428:qga/qemu-ga.exe.p/service-win32.c.obj] 错误 1 (已忽略)
../block/file-win32.c: In function 'raw_get_allocated_file_size':
../block/file-win32.c:566:59: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  566 |         (get_compressed_t)
GetProcAddress(GetModuleHandle("kernel32"),
      |                                                           ^~~~~~~~~~
      |                                                           |
      |                                                           const
char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
make: [Makefile.ninja:777:chardev/libchardev.fa.p/char-pipe.c.obj] 错误 1
(已忽略)
../block/file-win32.c: In function 'find_cdrom':
../block/file-win32.c:684:44: error: passing argument 2 of
'GetLogicalDriveStringsW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  684 |     GetLogicalDriveStrings(sizeof(drives), drives);
      |                                            ^~~~~~
      |                                            |
      |                                            char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:90:80:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   90 |   WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW (DWORD
nBufferLength, LPWSTR lpBuffer);
      |
    ~~~~~~~^~~~~~~~
../block/file-win32.c:686:29: error: passing argument 1 of 'GetDriveTypeW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  686 |         type = GetDriveType(pdrv);
      |                             ^~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~
../block/file-win32.c:693:25: error: passing argument 1 of 'lstrlenW' from
incompatible pointer type [-Werror=incompatible-pointer-types]
  693 |         pdrv += lstrlen(pdrv) + 1;
      |                         ^~~~
      |                         |
      |                         char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1430:43:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
 1430 |   WINBASEAPI int WINAPI lstrlenW (LPCWSTR lpString);
      |                                   ~~~~~~~~^~~~~~~~
../block/file-win32.c: In function 'find_device_type':
../block/file-win32.c:709:30: error: passing argument 1 of 'GetDriveTypeW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  709 |         type = GetDriveType(s->drive_path);
      |                             ~^~~~~~~~~~~~
      |                              |
      |                              char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~
../block/file-win32.c: In function 'hdev_open':
../block/file-win32.c:799:27: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  799 |     s->hfile = CreateFile(filename, access_flags,
      |                           ^~~~~~~~
      |                           |
      |                           const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../block/file-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/vss-win32.c: In function 'call_vss_provider_func':
../qga/vss-win32.c:38:23: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   38 |                       (char *)&msg, 0, NULL);
      |                       ^~~~~~~~~~~~
      |                       |
      |                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/vss-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
../qga/vss-win32.c: In function 'vss_init':
../qga/vss-win32.c:90:23: error: passing argument 5 of 'FormatMessageW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
   90 |                       (char *)&msg, 0, NULL);
      |                       ^~~~~~~~~~~~
      |                       |
      |                       char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/vss-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID
lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD
nSize, va_list *Arguments);
      |
                                              ~~~~~~~^~~~~~~~
In file included from C:/work/xemu/qemu/qga/vss-win32.h:16,
                 from ../qga/main.c:39:
../qga/main.c: In function 'quit_handler':
C:/work/xemu/qemu/qga/vss-win32/vss-handles.h:12:28: error: passing
argument 3 of 'OpenEventW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   12 | #define EVENT_NAME_TIMEOUT "Global\\QGAVSSEvent-timeout"
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            const char *
../qga/main.c:160:60: note: in expansion of macro 'EVENT_NAME_TIMEOUT'
  160 |         hEventTimeout = OpenEvent(EVENT_ALL_ACCESS, FALSE,
EVENT_NAME_TIMEOUT);
      |
 ^~~~~~~~~~~~~~~~~~
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:35,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/main.c:14:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/synchapi.h:55:95:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   55 |   WINBASEAPI HANDLE WINAPI OpenEventW (DWORD dwDesiredAccess,
WINBOOL bInheritHandle, LPCWSTR lpName);
      |
                  ~~~~~~~~^~~~~~
In file included from ../qga/main.c:38:
../qga/main.c: In function 'service_main':
C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 1 of
'RegisterServiceCtrlHandlerExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
   20 | #define QGA_SERVICE_NAME         "qemu-ga"
      |                                  ^~~~~~~~~
      |                                  |
      |                                  const char *
../qga/main.c:719:59: note: in expansion of macro 'QGA_SERVICE_NAME'
  719 |     service->status_handle =
RegisterServiceCtrlHandlerEx(QGA_SERVICE_NAME,
      |
^~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/main.c:14:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:319:80:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  319 |   WINADVAPI SERVICE_STATUS_HANDLE WINAPI
RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName,LPHANDLER_FUNCTION_EX
lpHandlerProc,LPVOID lpContext);
      |
   ~~~~~~~~^~~~~~~~~~~~~
../qga/main.c: In function 'main':
../qga/main.c:1542:15: error: initialization of 'WCHAR *' {aka 'short
unsigned int *'} from incompatible pointer type 'char *'
[-Werror=incompatible-pointer-types]
 1542 |             { (char *)QGA_SERVICE_NAME, service_main }, { NULL,
NULL } };
      |               ^
../qga/main.c:1542:15: note: (near initialization for
'service_table[0].lpServiceName')
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:1430:qga/qemu-ga.exe.p/vss-win32.c.obj] 错误 1 (已忽略)
make: [Makefile.ninja:1427:qga/qemu-ga.exe.p/channel-win32.c.obj] 错误 1 (已忽略)
make: [Makefile.ninja:896:libblock.fa.p/block_file-win32.c.obj] 错误 1 (已忽略)
Linking static target chardev/libchardev.fa
C:\CI-Tools\msys64\mingw64\bin\ar.exe:
chardev/libchardev.fa.p/char-win.c.obj: No such file or directory
make: [Makefile.ninja:780:chardev/libchardev.fa] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:1429:qga/qemu-ga.exe.p/main.c.obj] 错误 1 (已忽略)
cc1.exe: all warnings being treated as errors
make: [Makefile.ninja:882:libblock.fa.p/block.c.obj] 错误 1 (已忽略)
../util/oslib-win32.c: In function 'qemu_get_local_state_pathname':
../util/oslib-win32.c:289:58: error: passing argument 5 of
'SHGetFolderPathW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);
      |                                                          ^~~~~~~~~
      |                                                          |
      |                                                          char *
In file included from ../util/oslib-win32.c:44:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note:
expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE
hToken, DWORD dwFlags, LPWSTR pszPath);
      |
                ~~~~~~~^~~~~~~
../util/oslib-win32.c: In function 'qemu_init_exec_dir':
../util/oslib-win32.c:327:35: error: passing argument 2 of
'GetModuleFileNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
      |                                   ^~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule,
LPWSTR lpFilename, DWORD nSize);
      |
 ~~~~~~~^~~~~~~~~~
../util/oslib-win32.c: In function 'qemu_write_pidfile':
../util/oslib-win32.c:801:23: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ,
NULL,
      |                       ^~~~~~~~
      |                       |
      |                       const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'acquire_privilege':
../qga/commands-win32.c:285:41: error: passing argument 2 of
'LookupPrivilegeValueW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  285 |         if (!LookupPrivilegeValue(NULL, name,
&priv.Privileges[0].Luid)) {
      |                                         ^~~~
      |                                         |
      |                                         const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2519:81:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
 2519 |   WINADVAPI WINBOOL WINAPI LookupPrivilegeValueW (LPCWSTR
lpSystemName, LPCWSTR lpName, PLUID lpLuid);
      |
    ~~~~~~~~^~~~~~
../qga/commands-win32.c: In function 'qmp_guest_shutdown':
../qga/commands-win32.c:343:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  343 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'get_pci_info':
../qga/commands-win32.c:600:48: error: passing argument 3 of
'SetupDiGetDeviceInstanceIdW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  600 |                                                parent_dev_id, size,
&size)) {
      |                                                ^~~~~~~~~~~~~
      |                                                |
      |                                                char *
In file included from ../qga/commands-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1562:119:
note: expected 'PWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
 1562 |   WINSETUPAPI WINBOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO
DeviceInfoSet,PSP_DEVINFO_DATA DeviceInfoData,PWSTR DeviceInstanceId,DWORD
DeviceInstanceIdSize,PDWORD RequiredSize);
      |
                                            ~~~~~~^~~~~~~~~~~~~~~~
../qga/commands-win32.c:615:47: error: passing argument 2 of
'CM_Locate_DevNodeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  615 |             cr = CM_Locate_DevInst(&dev_inst, parent_dev_id, 0);
      |                                               ^~~~~~~~~~~~~
      |                                               |
      |                                               char *
In file included from ../qga/commands-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:887:77:
note: expected 'DEVINSTID_W' {aka 'short unsigned int *'} but argument is
of type 'char *'
  887 |   CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST
pdnDevInst,DEVINSTID_W pDeviceID,ULONG ulFlags);
      |
~~~~~~~~~~~~^~~~~~~~~
../qga/commands-win32.c:644:52: error: passing argument 2 of
'CM_Get_Device_IDW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  644 |             cr = CM_Get_Device_ID(parent_dev_inst, parent_dev_id,
dev_id_size,
      |                                                    ^~~~~~~~~~~~~
      |                                                    |
      |                                                    char *
In file included from ../qga/commands-win32.c:29:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:811:69:
note: expected 'PWCHAR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  811 |   CMAPI CONFIGRET WINAPI CM_Get_Device_IDW(DEVINST dnDevInst,PWCHAR
Buffer,ULONG BufferLen,ULONG ulFlags);
      |
 ~~~~~~~^~~~~~
../qga/commands-win32.c:657:65: error: passing argument 2 of
'SetupDiGetClassDevsW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  657 |             SetupDiGetClassDevs(&GUID_DEVINTERFACE_STORAGEPORT,
parent_dev_id,
      |
^~~~~~~~~~~~~
      |                                                                 |
      |
char *
In file included from ../qga/commands-win32.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1637:81:
note: expected 'PCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
 1637 |   WINSETUPAPI HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID
*ClassGuid,PCWSTR Enumerator,HWND hwndParent,DWORD Flags);
      |
     ~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'get_single_disk_info':
../qga/commands-win32.c:822:29: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  822 |     disk_h = CreateFile(disk->dev, 0, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
      |                         ~~~~^~~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'build_guest_disk_info':
../qga/commands-win32.c:891:24: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  891 |     vol_h = CreateFile(name, 0, FILE_SHARE_READ, NULL,
OPEN_EXISTING,
      |                        ^~~~
      |                        |
      |                        char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c: In function 'build_guest_fsinfo':
../qga/commands-win32.c:1003:37: error: passing argument 1 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0,
&info_size);
      |                                     ^~~~
      |                                     |
      |                                     char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
~~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1003:43: error: passing argument 2 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&mnt, 0,
&info_size);
      |                                           ^~~~~~~~~~
      |                                           |
      |                                           CHAR * {aka char *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93:
note: expected 'LPWCH' {aka 'short unsigned int *'} but argument is of type
'CHAR *' {aka 'char *'}
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
                  ~~~~~~^~~~~~~~~~~~~~~~~~~
../qga/commands-win32.c:1010:42: error: passing argument 1 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,
      |                                          ^~~~
      |                                          |
      |                                          char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
~~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1010:48: error: passing argument 2 of
'GetVolumePathNamesForVolumeNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,
      |                                                ^~~~~~~~~
      |                                                |
      |                                                char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93:
note: expected 'LPWCH' {aka 'short unsigned int *'} but argument is of type
'char *'
   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW
(LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength,
PDWORD lpcchReturnLength);
      |
                  ~~~~~~^~~~~~~~~~~~~~~~~~~
../qga/commands-win32.c:1016:35: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
 1016 |     hLocalDiskHandle = CreateFile(guid, 0 , 0, NULL, OPEN_EXISTING,
      |                                   ^~~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
../qga/commands-win32.c:1045:34: error: passing argument 1 of
'GetDiskFreeSpaceExW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1045 |         if (GetDiskFreeSpaceEx(fs->mountpoint,
      |                                ~~^~~~~~~~~~~~
      |                                  |
      |                                  char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'char *'
  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR
lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER
lpTotalNumberOfFreeBytes);
      |
 ~~~~~~~~^~~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_get_fsinfo':
../qga/commands-win32.c:1070:29: error: passing argument 1 of
'FindFirstVolumeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1070 |     vol_h = FindFirstVolume(guid, sizeof(guid));
      |                             ^~~~
      |                             |
      |                             char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:58:53:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   58 |   WINBASEAPI HANDLE WINAPI FindFirstVolumeW (LPWSTR lpszVolumeName,
DWORD cchBufferLength);
      |                                              ~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c:1089:36: error: passing argument 2 of
'FindNextVolumeW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1089 |     } while (FindNextVolume(vol_h, guid, sizeof(guid)));
      |                                    ^~~~
      |                                    |
      |                                    char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:60:73:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
   60 |   WINBASEAPI WINBOOL WINAPI FindNextVolumeW (HANDLE hFindVolume,
LPWSTR lpszVolumeName, DWORD cchBufferLength);
      |
 ~~~~~~~^~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_suspend_disk':
../qga/commands-win32.c:1372:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1372 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'qmp_guest_suspend_ram':
../qga/commands-win32.c:1395:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1395 |     acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'guest_addr_to_str':
../qga/commands-win32.c:1459:34: error: passing argument 4 of
'WSAAddressToStringW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1459 |                                  addr_str,
      |                                  ^~~~~~~~
      |                                  |
      |                                  char *
In file included from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:1086:141:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
 1086 |   WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringW(LPSOCKADDR
lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR
lpszAddressString,LPDWORD lpdwAddressStringLength);
      |

 ~~~~~~~^~~~~~~~~~~~~~~~~
../qga/commands-win32.c: In function 'guest_get_network_stats':
../qga/commands-win32.c:1509:42: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1509 |         HMODULE module = GetModuleHandle("iphlpapi");
      |                                          ^~~~~~~~~~
      |                                          |
      |                                          const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
../qga/commands-win32.c: In function 'qmp_guest_set_time':
../qga/commands-win32.c:1686:24: error: passing argument 1 of 'strerror_s'
from incompatible pointer type [-Werror=incompatible-pointer-types]
 1686 |             strerror_s((LPTSTR) & msg_buffer, 0, errno);
      |                        ^~~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        WCHAR * {aka short unsigned int *}
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/string.h:190,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:87,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h:26:44:
note: expected 'char *' but argument is of type 'WCHAR *' {aka 'short
unsigned int *'}
   26 |   _SECIMP errno_t __cdecl strerror_s(char *_Buf,size_t
_SizeInBytes,int _ErrNum);
      |                                      ~~~~~~^~~~
In file included from ../qga/commands-win32.c:39:
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 6 has type 'const WCHAR *' {aka
'const short unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../qga/commands-win32.c:1687:13: note: in expansion of macro 'error_setg'
 1687 |             error_setg(errp, "system(...) failed: %s",
(LPCTSTR)msg_buffer);
      |             ^~~~~~~~~~
C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s' expects
argument of type 'char *', but argument 7 has type 'const WCHAR *' {aka
'const short unsigned int *'} [-Werror=format=]
  319 |                         (fmt), ## __VA_ARGS__)
      |                         ^~~~~
../qga/commands-win32.c:1702:21: note: in expansion of macro 'error_setg'
 1702 |                     error_setg(errp, "w32tm failed with error
(0x%lx): %s", hr,
      |                     ^~~~~~~~~~
cc1.exe: all warnings being treated as errors
../qga/commands-win32.c:1731:23: error: passing argument 1 of
'acquire_privilege' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 1731 |     acquire_privilege(SE_SYSTEMTIME_NAME, &local_err);
      |                       ^~~~~~~~~~~~~~~~~~
      |                       |
      |                       const short unsigned int *
../qga/commands-win32.c:276:43: note: expected 'const char *' but argument
is of type 'const short unsigned int *'
  276 | static void acquire_privilege(const char *name, Error **errp)
      |                               ~~~~~~~~~~~~^~~~
../qga/commands-win32.c: In function 'ga_get_win_version':
../qga/commands-win32.c:2119:38: error: passing argument 1 of
'GetModuleHandleW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
 2119 |     HMODULE module = GetModuleHandle("ntdll");
      |                                      ^~~~~~~
      |                                      |
      |                                      const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../qga/commands-win32.c:13:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);
      |                                             ~~~~~~~~^~~~~~~~~~~~
make: [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1 (已忽略)
Linking static target libqemuutil.a

make[1]: 离开目录“/c/work/xemu/qemu/capstone”
"C:/CI-Tools/msys64/mingw64/bin/python3.exe"
"C:/work/xemu/qemu/meson/meson.py" "--internal" "exe" "--capture"
"qemu-version.h" "--" "sh" "C:/work/xemu/qemu/scripts/qemu-version.sh"
"C:/work/xemu/qemu" "" "5.1.50" && if test -e qemu-version.h; then printf
'%s\n' qemu-version.h > qemu-version.h.stamp; fi
"cc" "-Ilibqemuutil.a.p" "-I." "-I.." "-Iqapi" "-Itrace" "-Iui"
"-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
"-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
"-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
"-IC:/CI-Tools/msys64/mingw64/include/p11-kit-1" "-fdiagnostics-color=auto"
"-pipe" "-Wall" "-Winvalid-pch" "-Werror" "-std=gnu99" "-g" "-m64" "-mcx16"
"-DUNICODE" "-D_UNICODE" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64"
"-D_LARGEFILE_SOURCE" "-Wstrict-prototypes" "-Wredundant-decls" "-Wundef"
"-Wwrite-strings" "-Wmissing-prototypes" "-fno-strict-aliasing"
"-fno-common" "-fwrapv" "-Wold-style-declaration" "-Wold-style-definition"
"-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self"
"-Wignored-qualifiers" "-Wempty-body" "-Wnested-externs" "-Wendif-labels"
"-Wexpansion-to-defined" "-Wno-missing-include-dirs"
"-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong"
"-iquote" "/c/work/xemu/qemu/tcg/i386" "-iquote" "." "-iquote"
"/c/work/xemu/qemu" "-iquote" "/c/work/xemu/qemu/accel/tcg" "-iquote"
"/c/work/xemu/qemu/include" "-iquote" "/c/work/xemu/qemu/disas/libvixl"
"-pthread" "-mms-bitfields" "-mms-bitfields" -MD -MQ
libqemuutil.a.p/util_oslib-win32.c.obj -MF
"libqemuutil.a.p/util_oslib-win32.c.obj.d" -o
libqemuutil.a.p/util_oslib-win32.c.obj "-c" ../util/oslib-win32.c -MP
../util/oslib-win32.c: In function 'qemu_get_local_state_pathname':
../util/oslib-win32.c:289:58: error: passing argument 5 of
'SHGetFolderPathW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);
      |                                                          ^~~~~~~~~
      |                                                          |
      |                                                          char *
In file included from ../util/oslib-win32.c:44:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note:
expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of type
'char *'
   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE
hToken, DWORD dwFlags, LPWSTR pszPath);
      |
                ~~~~~~~^~~~~~~
../util/oslib-win32.c: In function 'qemu_init_exec_dir':
../util/oslib-win32.c:327:35: error: passing argument 2 of
'GetModuleFileNameW' from incompatible pointer type
[-Werror=incompatible-pointer-types]
  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
      |                                   ^~~
      |                                   |
      |                                   char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71:
note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
type 'char *'
  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule,
LPWSTR lpFilename, DWORD nSize);
      |
 ~~~~~~~^~~~~~~~~~
../util/oslib-win32.c: In function 'qemu_write_pidfile':
../util/oslib-win32.c:801:23: error: passing argument 1 of 'CreateFileW'
from incompatible pointer type [-Werror=incompatible-pointer-types]
  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ,
NULL,
      |                       ^~~~~~~~
      |                       |
      |                       const char *
In file included from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,
                 from
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../util/oslib-win32.c:33:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49:
note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument is
of type 'const char *'
   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD
dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES
lpSecurityAttributes, DWORD dwCreationDisposition, DWORD
dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~~^~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: *** [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1
```



>

> -- >8 --

> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h

> index 412962d91a2..cd5cedc0b21 100644

> --- a/include/qemu/osdep.h

> +++ b/include/qemu/osdep.h

> @@ -74,6 +74,12 @@ extern int daemon(int, int);

>  /* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)

*/
>  #ifdef __MINGW32__

>  #define __USE_MINGW_ANSI_STDIO 1

> +#ifndef UNICODE

> +#define UNICODE

> +#endif

> +#ifndef _UNICODE

> +#define _UNICODE

> +#endif

>  #endif

>

>  #include <stdarg.h>

> ---

>

> >    vhost_user="no"

> >    audio_possible_drivers="dsound sdl"

> >    if check_include dsound.h; then

> >

>



--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
<div dir="ltr"><br><br>On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt; wrote:<br>&gt;<br>&gt; On 9/15/20 6:33 PM, Yonggang Luo wrote:<br>&gt; &gt; error message:<br>&gt; &gt; &quot;cc&quot; &quot;-Iqga/qemu-ga.exe.p&quot; &quot;-Iqga&quot; &quot;-I../qga&quot; &quot;-I.&quot; &quot;-Iqapi&quot; &quot;-Itrace&quot; &quot;-Iui&quot; &quot;-Iui/shader&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include/glib-2.0&quot; &quot;-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include&quot; &quot;-fdiagnostics-color=auto&quot; &quot;-pipe&quot; &quot;-Wall&quot; &quot;-Winvalid-pch&quot; &quot;-Werror&quot; &quot;-std=gnu99&quot; &quot;-g&quot; &quot;-m64&quot; &quot;-mcx16&quot; &quot;-D_GNU_SOURCE&quot; &quot;-D_FILE_OFFSET_BITS=64&quot; &quot;-D_LARGEFILE_SOURCE&quot; &quot;-Wstrict-prototypes&quot; &quot;-Wredundant-decls&quot; &quot;-Wundef&quot; &quot;-Wwrite-strings&quot; &quot;-Wmissing-prototypes&quot; &quot;-fno-strict-aliasing&quot; &quot;-fno-common&quot; &quot;-fwrapv&quot; &quot;-Wold-style-declaration&quot; &quot;-Wold-style-definition&quot; &quot;-Wtype-limits&quot; &quot;-Wformat-security&quot; &quot;-Wformat-y2k&quot; &quot;-Winit-self&quot; &quot;-Wignored-qualifiers&quot; &quot;-Wempty-body&quot; &quot;-Wnested-externs&quot; &quot;-Wendif-labels&quot; &quot;-Wexpansion-to-defined&quot; &quot;-Wno-missing-include-dirs&quot; &quot;-Wno-shift-negative-value&quot; &quot;-Wno-psabi&quot; &quot;-fstack-protector-strong&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/tcg/i386&quot; &quot;-iquote&quot; &quot;.&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/accel/tcg&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/include&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/disas/libvixl&quot; &quot;-pthread&quot; &quot;-mms-bitfields&quot; -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF &quot;qga/qemu-ga.exe.p/commands-win32.c.obj.d&quot; -o qga/qemu-ga.exe.p/commands-win32.c.obj &quot;-c&quot; ../qga/commands-win32.c -MP<br>&gt; &gt; ../qga/commands-win32.c:62:24: error: redundant redeclaration of &#39;CM_Get_DevNode_PropertyW&#39; [-Werror=redundant-decls]<br>&gt; &gt;    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>&gt; &gt;       |                        ^~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt; In file included from ../qga/commands-win32.c:26:<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of &#39;CM_Get_DevNode_PropertyW&#39; was here<br>&gt; &gt;   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);<br>&gt; &gt;       |                          ^~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt; cc1.exe: all warnings being treated as errors<br>&gt; &gt; make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj] 错误 1 (已忽略)<br>&gt; &gt;<br>&gt; &gt; This error comes from qemu configure didn&#39;t add predefined macro -DUNICODE -D_UNICODE in QEMU_CFLAGS,<br>&gt; &gt; and these too macro are standard config for win32 if using windows wide api.<br>&gt; &gt;<br>&gt; &gt; in cfgmgr32.h<br>&gt; &gt;   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);<br>&gt; &gt; #ifdef UNICODE<br>&gt; &gt; #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW<br>&gt; &gt; #endif<br>&gt; &gt;<br>&gt; &gt; macro CM_Get_DevNode_Property defined only when UNICODE are defined.<br>&gt; &gt; and in win32, UNICODE and _UNICODE should be defined at the same time<br>&gt; &gt;<br>&gt; &gt; #endif<br>&gt; &gt;<br>&gt; &gt; Signed-off-by: Yonggang Luo &lt;<a href="mailto:luoyonggang@gmail.com">luoyonggang@gmail.com</a>&gt;<br>&gt; &gt; ---<br>&gt; &gt;  configure | 1 +<br>&gt; &gt;  1 file changed, 1 insertion(+)<br>&gt; &gt;<br>&gt; &gt; diff --git a/configure b/configure<br>&gt; &gt; index 9f141891ea..f5d661af4a 100755<br>&gt; &gt; --- a/configure<br>&gt; &gt; +++ b/configure<br>&gt; &gt; @@ -812,6 +812,7 @@ MINGW32*)<br>&gt; &gt;    mingw32=&quot;yes&quot;<br>&gt; &gt;    hax=&quot;yes&quot;<br>&gt; &gt;    whpx=&quot;&quot;<br>&gt; &gt; +  QEMU_CFLAGS=&quot;-DUNICODE -D_UNICODE $QEMU_CFLAGS&quot;<br>&gt;<br>&gt; What about declaring them in include/qemu/osdep.h<br>&gt; instead?<div>That&#39;s a good idea.</div><div>But more compiling error warns me that the windows version of qemu are not in a good situation.</div><div>On Win32, all API should call the wide version so that support for Unicode properly.</div><div>But obviously the currently qemu didn&#39;t do that</div><div></div><div><br></div><div>```</div><div><br></div><div>Compiling C object qga/qemu-ga.exe.p/commands-win32.c.obj<br>In file included from ../util/qemu-sockets.c:27:<br>../util/qemu-sockets.c: In function &#39;inet_listen_saddr&#39;:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../util/qemu-sockets.c:274:9: note: in expansion of macro &#39;error_setg&#39;<br>  274 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;,<br>      |         ^~~~~~~~~~<br>../util/qemu-sockets.c: In function &#39;inet_parse_connect_saddr&#39;:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../util/qemu-sockets.c:429:9: note: in expansion of macro &#39;error_setg&#39;<br>  429 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;,<br>      |         ^~~~~~~~~~<br>../util/qemu-sockets.c: In function &#39;inet_dgram_saddr&#39;:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../util/qemu-sockets.c:518:9: note: in expansion of macro &#39;error_setg&#39;<br>  518 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;, addr, port,<br>      |         ^~~~~~~~~~<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../util/qemu-sockets.c:544:9: note: in expansion of macro &#39;error_setg&#39;<br>  544 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;, addr, port,<br>      |         ^~~~~~~~~~<br>../util/qemu-sockets.c: In function &#39;socket_sockaddr_to_address_inet&#39;:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 6 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../util/qemu-sockets.c:1235:9: note: in expansion of macro &#39;error_setg&#39;<br> 1235 |         error_setg(errp, &quot;Cannot format numeric socket address: %s&quot;,<br>      |         ^~~~~~~~~~<br>In file included from ../io/dns-resolver.c:26:<br>../io/dns-resolver.c: In function &#39;qio_dns_resolver_lookup_sync_inet&#39;:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../io/dns-resolver.c:93:9: note: in expansion of macro &#39;error_setg&#39;<br>   93 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;,<br>      |         ^~~~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已忽略)<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误 1 (已忽略)<br>Linking static target io/libio.fa<br>C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj: No such file or directory<br>make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)<br>../net/tap-win32.c: In function &#39;is_tap_win32_dev&#39;:<br>../net/tap-win32.c:62:21: error: passing argument 2 of &#39;RegOpenKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   62 | #define ADAPTER_KEY &quot;SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>      |                     |<br>      |                     const char *<br>../net/tap-win32.c:62:21: note: in definition of macro &#39;ADAPTER_KEY&#39;<br>   62 | #define ADAPTER_KEY &quot;SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);<br>      |                                                 ~~~~~~~~^~~~~~~~<br>../net/tap-win32.c:229:13: error: passing argument 3 of &#39;RegEnumKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  229 |             enum_name,<br>      |             ^~~~~~~~~<br>      |             |<br>      |             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);<br>      |                                                               ~~~~~~~^~~~~~<br>../net/tap-win32.c:247:13: error: passing argument 2 of &#39;RegOpenKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  247 |             unit_string,<br>      |             ^~~~~~~~~~~<br>      |             |<br>      |             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);<br>      |                                                 ~~~~~~~~^~~~~~~~<br>../net/tap-win32.c:258:17: error: passing argument 2 of &#39;RegQueryValueExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  258 |                 component_id_string,<br>      |                 ^~~~~~~~~~~~~~~~~~~<br>      |                 |<br>      |                 char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);<br>      |                                                    ~~~~~~~~^~~~~~~~~~~<br>../net/tap-win32.c:268:21: error: passing argument 2 of &#39;RegQueryValueExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  268 |                     net_cfg_instance_id_string,<br>      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~<br>      |                     |<br>      |                     char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);<br>      |                                                    ~~~~~~~~^~~~~~~~~~~<br>../net/tap-win32.c: In function &#39;get_device_guid&#39;:<br>../net/tap-win32.c:64:33: error: passing argument 2 of &#39;RegOpenKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   64 | #define NETWORK_CONNECTIONS_KEY &quot;SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>      |                                 |<br>      |                                 const char *<br>../net/tap-win32.c:64:33: note: in definition of macro &#39;NETWORK_CONNECTIONS_KEY&#39;<br>   64 | #define NETWORK_CONNECTIONS_KEY &quot;SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);<br>      |                                                 ~~~~~~~~^~~~~~~~<br>../net/tap-win32.c:328:13: error: passing argument 3 of &#39;RegEnumKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  328 |             enum_name,<br>      |             ^~~~~~~~~<br>      |             |<br>      |             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);<br>      |                                                               ~~~~~~~^~~~~~<br>../net/tap-win32.c:348:13: error: passing argument 2 of &#39;RegOpenKeyExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  348 |             connection_string,<br>      |             ^~~~~~~~~~~~~~~~~<br>      |             |<br>      |             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);<br>      |                                                 ~~~~~~~~^~~~~~~~<br>../net/tap-win32.c:357:17: error: passing argument 2 of &#39;RegQueryValueExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  357 |                 name_string,<br>      |                 ^~~~~~~~~~~<br>      |                 |<br>      |                 const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:203:60: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  203 |   WINADVAPI LONG WINAPI RegQueryValueExW(HKEY hKey,LPCWSTR lpValueName,LPDWORD lpReserved,LPDWORD lpType,LPBYTE lpData,LPDWORD lpcbData);<br>      |                                                    ~~~~~~~~^~~~~~~~~~~<br>../net/tap-win32.c: In function &#39;tap_win32_open&#39;:<br>../net/tap-win32.c:626:9: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  626 |         device_path,<br>      |         ^~~~~~~~~~~<br>      |         |<br>      |         char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../net/tap-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../chardev/char-win.c: In function &#39;win_chr_serial_init&#39;:<br>../chardev/char-win.c:96:26: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   96 |     s-&gt;file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,<br>      |                          ^~~~~~~~<br>      |                          |<br>      |                          const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../chardev/char-win.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../chardev/char-win.c:111:26: error: passing argument 1 of &#39;GetDefaultCommConfigW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  111 |     GetDefaultCommConfig(filename, &amp;comcfg, &amp;size);<br>      |                          ^~~~~~~~<br>      |                          |<br>      |                          const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../chardev/char-win.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2394:60: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br> 2394 |   WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigW (LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);<br>      |                                                    ~~~~~~~~^~~~~~~~<br>../chardev/char-win.c:113:22: error: passing argument 1 of &#39;CommConfigDialogW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  113 |     CommConfigDialog(filename, NULL, &amp;comcfg);<br>      |                      ^~~~~~~~<br>      |                      |<br>      |                      const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../chardev/char-win.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2392:56: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br> 2392 |   WINBASEAPI WINBOOL WINAPI CommConfigDialogW (LPCWSTR lpszName, HWND hWnd, LPCOMMCONFIG lpCC);<br>      |                                                ~~~~~~~~^~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>cc1.exe: all warnings being treated as errors<br>../chardev/char-file.c: In function &#39;qmp_chardev_open_file&#39;:<br>../chardev/char-file.c:63:26: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   63 |     out = CreateFile(file-&gt;out, accessmode, FILE_SHARE_READ, NULL, flags,<br>      |                      ~~~~^~~~~<br>      |                          |<br>      |                          char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../chardev/char-file.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../block.c: In function &#39;get_tmp_filename&#39;:<br>../block.c:757:35: error: passing argument 2 of &#39;GetTempPathW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  757 |     return (GetTempPath(MAX_PATH, temp_dir)<br>      |                                   ^~~~~~~~<br>      |                                   |<br>      |                                   char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:188:69: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  188 |   WINBASEAPI DWORD WINAPI GetTempPathW (DWORD nBufferLength, LPWSTR lpBuffer);<br>      |                                                              ~~~~~~~^~~~~~~~<br>../block.c:758:32: error: passing argument 1 of &#39;GetTempFileNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  758 |             &amp;&amp; GetTempFileName(temp_dir, &quot;qem&quot;, 0, filename)<br>      |                                ^~~~~~~~<br>      |                                |<br>      |                                char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:52: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);<br>      |                                            ~~~~~~~~^~~~~~~~~~<br>../block.c:758:42: error: passing argument 2 of &#39;GetTempFileNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  758 |             &amp;&amp; GetTempFileName(temp_dir, &quot;qem&quot;, 0, filename)<br>      |                                          ^~~~~<br>      |                                          |<br>      |                                          const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:72: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);<br>      |                                                                ~~~~~~~~^~~~~~~~~~~~~~<br>../block.c:758:52: error: passing argument 4 of &#39;GetTempFileNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  758 |             &amp;&amp; GetTempFileName(temp_dir, &quot;qem&quot;, 0, filename)<br>      |                                                    ^~~~~~~~<br>      |                                                    |<br>      |                                                    char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:127:109: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  127 |   WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);<br>      |                                                                                                      ~~~~~~~^~~~~~~~~~~~~~<br>../chardev/char-pipe.c: In function &#39;win_chr_pipe_init&#39;:<br>../chardev/char-pipe.c:66:31: error: passing argument 1 of &#39;CreateNamedPipeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   66 |     s-&gt;file = CreateNamedPipe(openname,<br>      |                               ^~~~~~~~<br>      |                               |<br>      |                               char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:26,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../chardev/char-pipe.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/namedpipeapi.h:28:54: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   28 |   WINBASEAPI HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes);<br>      |                                              ~~~~~~~~^~~~~~<br>../qga/service-win32.c: In function &#39;printf_win_error&#39;:<br>../qga/service-win32.c:28:9: error: passing argument 5 of &#39;FormatMessageW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   28 |         (char *)&amp;message, 0,<br>      |         ^~~~~~~~~~~~~~~~<br>      |         |<br>      |         char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/service-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);<br>      |                                                                                                                   ~~~~~~~^~~~~~~~<br>../qga/service-win32.c: In function &#39;ga_install_service&#39;:<br>../qga/service-win32.c:107:34: error: initialization of &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} from incompatible pointer type &#39;char *&#39; [-Werror=incompatible-pointer-types]<br>  107 |     SERVICE_DESCRIPTION desc = { (char *)QGA_SERVICE_DESCRIPTION };<br>      |                                  ^<br>../qga/service-win32.c:107:34: note: (near initialization for &#39;desc.lpDescription&#39;)<br>../qga/service-win32.c:118:43: error: passing argument 1 of &#39;win_escape_arg&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  118 |                            win_escape_arg(module_fname, esc));<br>      |                                           ^~~~~~~~~~~~<br>      |                                           |<br>      |                                           TCHAR * {aka short unsigned int *}<br>../qga/service-win32.c:42:47: note: expected &#39;const char *&#39; but argument is of type &#39;TCHAR *&#39; {aka &#39;short unsigned int *&#39;}<br>   42 | static const char *win_escape_arg(const char *to_escape, GString *buffer)<br>      |                                   ~~~~~~~~~~~~^~~~~~~~~<br>In file included from ../qga/service-win32.c:15:<br>C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of &#39;CreateServiceW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   20 | #define QGA_SERVICE_NAME         &quot;qemu-ga&quot;<br>      |                                  ^~~~~~~~~<br>      |                                  |<br>      |                                  const char *<br>../qga/service-win32.c:140:38: note: in expansion of macro &#39;QGA_SERVICE_NAME&#39;<br>  140 |     service = CreateService(manager, QGA_SERVICE_NAME, QGA_SERVICE_DISPLAY_NAME,<br>      |                                      ^~~~~~~~~~~~~~~~<br>make: [Makefile.ninja:767:chardev/libchardev.fa.p/char-win.c.obj] 错误 1 (已忽略)<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/service-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:74: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR lpPassword);<br>      |                                                                  ~~~~~~~~^~~~~~~~~~~~~<br>In file included from ../qga/service-win32.c:15:<br>C:/work/xemu/qemu/qga/service-win32.h:19:34: error: passing argument 3 of &#39;CreateServiceW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   19 | #define QGA_SERVICE_DISPLAY_NAME &quot;QEMU Guest Agent&quot;<br>      |                                  ^~~~~~~~~~~~~~~~~~<br>      |                                  |<br>      |                                  const char *<br>../qga/service-win32.c:140:56: note: in expansion of macro &#39;QGA_SERVICE_DISPLAY_NAME&#39;<br>  140 |     service = CreateService(manager, QGA_SERVICE_NAME, QGA_SERVICE_DISPLAY_NAME,<br>      |                                                        ^~~~~~~~~~~~~~~~~~~~~~~~<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/service-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:96: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR lpPassword);<br>      |                                                                                        ~~~~~~~~^~~~~~~~~~~~~<br>../qga/service-win32.c:142:38: error: passing argument 8 of &#39;CreateServiceW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  142 |         SERVICE_ERROR_NORMAL, cmdline-&gt;str, NULL, NULL, NULL, NULL, NULL);<br>      |                               ~~~~~~~^~~~~<br>      |                                      |<br>      |                                      gchar * {aka char *}<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/service-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:289:199: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;gchar *&#39; {aka &#39;char *&#39;}<br>  289 |   WINADVAPI SC_HANDLE WINAPI CreateServiceW(SC_HANDLE hSCManager,LPCWSTR lpServiceName,LPCWSTR lpDisplayName,DWORD dwDesiredAccess,DWORD dwServiceType,DWORD dwStartType,DWORD dwErrorControl,LPCWSTR lpBinaryPathName,LPCWSTR lpLoadOrderGroup,LPDWORD lpdwTagId,LPCWSTR lpDependencies,LPCWSTR lpServiceStartName,LPCWSTR lpPassword);<br>      |                                                                                                                                                                                               ~~~~~~~~^~~~~~~~~~~~~~~~<br>In file included from ../qga/service-win32.c:15:<br>../qga/service-win32.c: In function &#39;ga_uninstall_service&#39;:<br>C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 2 of &#39;OpenServiceW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   20 | #define QGA_SERVICE_NAME         &quot;qemu-ga&quot;<br>      |                                  ^~~~~~~~~<br>      |                                  |<br>      |                                  const char *<br>../qga/service-win32.c:173:36: note: in expansion of macro &#39;QGA_SERVICE_NAME&#39;<br>  173 |     service = OpenService(manager, QGA_SERVICE_NAME, DELETE);<br>      |                                    ^~~~~~~~~~~~~~~~<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/service-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:306:72: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  306 |   WINADVAPI SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager,LPCWSTR lpServiceName,DWORD dwDesiredAccess);<br>      |                                                                ~~~~~~~~^~~~~~~~~~~~~<br>../qga/channel-win32.c: In function &#39;ga_channel_open&#39;:<br>../qga/channel-win32.c:301:28: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  301 |     c-&gt;handle = CreateFile(newpath, GENERIC_READ | GENERIC_WRITE, 0, NULL,<br>      |                            ^~~~~~~<br>      |                            |<br>      |                            gchar * {aka char *}<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/channel-win32.c:1:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;gchar *&#39; {aka &#39;char *&#39;}<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>make: [Makefile.ninja:952:libcommon.fa.p/net_tap-win32.c.obj] 错误 1 (已忽略)<br>cc1.exe: all warnings being treated as errors<br>cc1.exe: all warnings being treated as errors<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:773:chardev/libchardev.fa.p/char-file.c.obj] 错误 1 (已忽略)<br>../block/file-win32.c: In function &#39;raw_probe_alignment&#39;:<br>../block/file-win32.c:250:27: error: passing argument 1 of &#39;GetDiskFreeSpaceW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  250 |         GetDiskFreeSpace(s-&gt;drive_path, &amp;sectorsPerCluster,<br>      |                          ~^~~~~~~~~~~~<br>      |                           |<br>      |                           char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:74:56: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   74 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceW (LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);<br>      |                                                ~~~~~~~~^~~~~~~~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>../block/file-win32.c: In function &#39;raw_open&#39;:<br>../block/file-win32.c:390:39: error: passing argument 2 of &#39;GetCurrentDirectoryW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  390 |         GetCurrentDirectory(MAX_PATH, buf);<br>      |                                       ^~~<br>      |                                       |<br>      |                                       char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:28,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/processenv.h:23:77: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   23 |   WINBASEAPI DWORD WINAPI GetCurrentDirectoryW (DWORD nBufferLength, LPWSTR lpBuffer);<br>      |                                                                      ~~~~~~~^~~~~~~~<br>../block/file-win32.c:394:27: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  394 |     s-&gt;hfile = CreateFile(filename, access_flags,<br>      |                           ^~~~~~~~<br>      |                           |<br>      |                           const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../block/file-win32.c: In function &#39;raw_getlength&#39;:<br>../block/file-win32.c:540:34: error: passing argument 1 of &#39;GetDiskFreeSpaceExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  540 |         if (!GetDiskFreeSpaceEx(s-&gt;drive_path, &amp;available, &amp;total, &amp;total_free))<br>      |                                 ~^~~~~~~~~~~~<br>      |                                  |<br>      |                                  char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);<br>      |                                                  ~~~~~~~~^~~~~~~~~~~~~~~<br>make: [Makefile.ninja:1428:qga/qemu-ga.exe.p/service-win32.c.obj] 错误 1 (已忽略)<br>../block/file-win32.c: In function &#39;raw_get_allocated_file_size&#39;:<br>../block/file-win32.c:566:59: error: passing argument 1 of &#39;GetModuleHandleW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  566 |         (get_compressed_t) GetProcAddress(GetModuleHandle(&quot;kernel32&quot;),<br>      |                                                           ^~~~~~~~~~<br>      |                                                           |<br>      |                                                           const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);<br>      |                                             ~~~~~~~~^~~~~~~~~~~~<br>make: [Makefile.ninja:777:chardev/libchardev.fa.p/char-pipe.c.obj] 错误 1 (已忽略)<br>../block/file-win32.c: In function &#39;find_cdrom&#39;:<br>../block/file-win32.c:684:44: error: passing argument 2 of &#39;GetLogicalDriveStringsW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  684 |     GetLogicalDriveStrings(sizeof(drives), drives);<br>      |                                            ^~~~~~<br>      |                                            |<br>      |                                            char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:90:80: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   90 |   WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW (DWORD nBufferLength, LPWSTR lpBuffer);<br>      |                                                                         ~~~~~~~^~~~~~~~<br>../block/file-win32.c:686:29: error: passing argument 1 of &#39;GetDriveTypeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  686 |         type = GetDriveType(pdrv);<br>      |                             ^~~~<br>      |                             |<br>      |                             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);<br>      |                                         ~~~~~~~~^~~~~~~~~~~~~~<br>../block/file-win32.c:693:25: error: passing argument 1 of &#39;lstrlenW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  693 |         pdrv += lstrlen(pdrv) + 1;<br>      |                         ^~~~<br>      |                         |<br>      |                         char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1430:43: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1430 |   WINBASEAPI int WINAPI lstrlenW (LPCWSTR lpString);<br>      |                                   ~~~~~~~~^~~~~~~~<br>../block/file-win32.c: In function &#39;find_device_type&#39;:<br>../block/file-win32.c:709:30: error: passing argument 1 of &#39;GetDriveTypeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  709 |         type = GetDriveType(s-&gt;drive_path);<br>      |                             ~^~~~~~~~~~~~<br>      |                              |<br>      |                              char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:76:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   76 |   WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);<br>      |                                         ~~~~~~~~^~~~~~~~~~~~~~<br>../block/file-win32.c: In function &#39;hdev_open&#39;:<br>../block/file-win32.c:799:27: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  799 |     s-&gt;hfile = CreateFile(filename, access_flags,<br>      |                           ^~~~~~~~<br>      |                           |<br>      |                           const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../block/file-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../qga/vss-win32.c: In function &#39;call_vss_provider_func&#39;:<br>../qga/vss-win32.c:38:23: error: passing argument 5 of &#39;FormatMessageW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   38 |                       (char *)&amp;msg, 0, NULL);<br>      |                       ^~~~~~~~~~~~<br>      |                       |<br>      |                       char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/vss-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);<br>      |                                                                                                                   ~~~~~~~^~~~~~~~<br>../qga/vss-win32.c: In function &#39;vss_init&#39;:<br>../qga/vss-win32.c:90:23: error: passing argument 5 of &#39;FormatMessageW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   90 |                       (char *)&amp;msg, 0, NULL);<br>      |                       ^~~~~~~~~~~~<br>      |                       |<br>      |                       char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/vss-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:1366:122: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1366 |   WINBASEAPI DWORD WINAPI FormatMessageW (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);<br>      |                                                                                                                   ~~~~~~~^~~~~~~~<br>In file included from C:/work/xemu/qemu/qga/vss-win32.h:16,<br>                 from ../qga/main.c:39:<br>../qga/main.c: In function &#39;quit_handler&#39;:<br>C:/work/xemu/qemu/qga/vss-win32/vss-handles.h:12:28: error: passing argument 3 of &#39;OpenEventW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   12 | #define EVENT_NAME_TIMEOUT &quot;Global\\QGAVSSEvent-timeout&quot;<br>      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>      |                            |<br>      |                            const char *<br>../qga/main.c:160:60: note: in expansion of macro &#39;EVENT_NAME_TIMEOUT&#39;<br>  160 |         hEventTimeout = OpenEvent(EVENT_ALL_ACCESS, FALSE, EVENT_NAME_TIMEOUT);<br>      |                                                            ^~~~~~~~~~~~~~~~~~<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:35,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/main.c:14:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/synchapi.h:55:95: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   55 |   WINBASEAPI HANDLE WINAPI OpenEventW (DWORD dwDesiredAccess, WINBOOL bInheritHandle, LPCWSTR lpName);<br>      |                                                                                       ~~~~~~~~^~~~~~<br>In file included from ../qga/main.c:38:<br>../qga/main.c: In function &#39;service_main&#39;:<br>C:/work/xemu/qemu/qga/service-win32.h:20:34: error: passing argument 1 of &#39;RegisterServiceCtrlHandlerExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>   20 | #define QGA_SERVICE_NAME         &quot;qemu-ga&quot;<br>      |                                  ^~~~~~~~~<br>      |                                  |<br>      |                                  const char *<br>../qga/main.c:719:59: note: in expansion of macro &#39;QGA_SERVICE_NAME&#39;<br>  719 |     service-&gt;status_handle = RegisterServiceCtrlHandlerEx(QGA_SERVICE_NAME,<br>      |                                                           ^~~~~~~~~~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:122,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/main.c:14:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsvc.h:319:80: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  319 |   WINADVAPI SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName,LPHANDLER_FUNCTION_EX lpHandlerProc,LPVOID lpContext);<br>      |                                                                        ~~~~~~~~^~~~~~~~~~~~~<br>../qga/main.c: In function &#39;main&#39;:<br>../qga/main.c:1542:15: error: initialization of &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;} from incompatible pointer type &#39;char *&#39; [-Werror=incompatible-pointer-types]<br> 1542 |             { (char *)QGA_SERVICE_NAME, service_main }, { NULL, NULL } };<br>      |               ^<br>../qga/main.c:1542:15: note: (near initialization for &#39;service_table[0].lpServiceName&#39;)<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:1430:qga/qemu-ga.exe.p/vss-win32.c.obj] 错误 1 (已忽略)<br>make: [Makefile.ninja:1427:qga/qemu-ga.exe.p/channel-win32.c.obj] 错误 1 (已忽略)<br>make: [Makefile.ninja:896:libblock.fa.p/block_file-win32.c.obj] 错误 1 (已忽略)<br>Linking static target chardev/libchardev.fa<br>C:\CI-Tools\msys64\mingw64\bin\ar.exe: chardev/libchardev.fa.p/char-win.c.obj: No such file or directory<br>make: [Makefile.ninja:780:chardev/libchardev.fa] 错误 1 (已忽略)<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:1429:qga/qemu-ga.exe.p/main.c.obj] 错误 1 (已忽略)<br>cc1.exe: all warnings being treated as errors<br>make: [Makefile.ninja:882:libblock.fa.p/block.c.obj] 错误 1 (已忽略)<br>../util/oslib-win32.c: In function &#39;qemu_get_local_state_pathname&#39;:<br>../util/oslib-win32.c:289:58: error: passing argument 5 of &#39;SHGetFolderPathW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);<br>      |                                                          ^~~~~~~~~<br>      |                                                          |<br>      |                                                          char *<br>In file included from ../util/oslib-win32.c:44:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);<br>      |                                                                                     ~~~~~~~^~~~~~~<br>../util/oslib-win32.c: In function &#39;qemu_init_exec_dir&#39;:<br>../util/oslib-win32.c:327:35: error: passing argument 2 of &#39;GetModuleFileNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);<br>      |                                   ^~~<br>      |                                   |<br>      |                                   char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../util/oslib-win32.c:33:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule, LPWSTR lpFilename, DWORD nSize);<br>      |                                                                ~~~~~~~^~~~~~~~~~<br>../util/oslib-win32.c: In function &#39;qemu_write_pidfile&#39;:<br>../util/oslib-win32.c:801:23: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,<br>      |                       ^~~~~~~~<br>      |                       |<br>      |                       const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../util/oslib-win32.c:33:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;acquire_privilege&#39;:<br>../qga/commands-win32.c:285:41: error: passing argument 2 of &#39;LookupPrivilegeValueW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  285 |         if (!LookupPrivilegeValue(NULL, name, &amp;priv.Privileges[0].Luid)) {<br>      |                                         ^~~~<br>      |                                         |<br>      |                                         const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:2519:81: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br> 2519 |   WINADVAPI WINBOOL WINAPI LookupPrivilegeValueW (LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid);<br>      |                                                                         ~~~~~~~~^~~~~~<br>../qga/commands-win32.c: In function &#39;qmp_guest_shutdown&#39;:<br>../qga/commands-win32.c:343:23: error: passing argument 1 of &#39;acquire_privilege&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  343 |     acquire_privilege(SE_SHUTDOWN_NAME, &amp;local_err);<br>      |                       ^~~~~~~~~~~~~~~~<br>      |                       |<br>      |                       const short unsigned int *<br>../qga/commands-win32.c:276:43: note: expected &#39;const char *&#39; but argument is of type &#39;const short unsigned int *&#39;<br>  276 | static void acquire_privilege(const char *name, Error **errp)<br>      |                               ~~~~~~~~~~~~^~~~<br>../qga/commands-win32.c: In function &#39;get_pci_info&#39;:<br>../qga/commands-win32.c:600:48: error: passing argument 3 of &#39;SetupDiGetDeviceInstanceIdW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  600 |                                                parent_dev_id, size, &amp;size)) {<br>      |                                                ^~~~~~~~~~~~~<br>      |                                                |<br>      |                                                char *<br>In file included from ../qga/commands-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1562:119: note: expected &#39;PWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1562 |   WINSETUPAPI WINBOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet,PSP_DEVINFO_DATA DeviceInfoData,PWSTR DeviceInstanceId,DWORD DeviceInstanceIdSize,PDWORD RequiredSize);<br>      |                                                                                                                 ~~~~~~^~~~~~~~~~~~~~~~<br>../qga/commands-win32.c:615:47: error: passing argument 2 of &#39;CM_Locate_DevNodeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  615 |             cr = CM_Locate_DevInst(&amp;dev_inst, parent_dev_id, 0);<br>      |                                               ^~~~~~~~~~~~~<br>      |                                               |<br>      |                                               char *<br>In file included from ../qga/commands-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:887:77: note: expected &#39;DEVINSTID_W&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  887 |   CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST pdnDevInst,DEVINSTID_W pDeviceID,ULONG ulFlags);<br>      |                                                                 ~~~~~~~~~~~~^~~~~~~~~<br>../qga/commands-win32.c:644:52: error: passing argument 2 of &#39;CM_Get_Device_IDW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  644 |             cr = CM_Get_Device_ID(parent_dev_inst, parent_dev_id, dev_id_size,<br>      |                                                    ^~~~~~~~~~~~~<br>      |                                                    |<br>      |                                                    char *<br>In file included from ../qga/commands-win32.c:29:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:811:69: note: expected &#39;PWCHAR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  811 |   CMAPI CONFIGRET WINAPI CM_Get_Device_IDW(DEVINST dnDevInst,PWCHAR Buffer,ULONG BufferLen,ULONG ulFlags);<br>      |                                                              ~~~~~~~^~~~~~<br>../qga/commands-win32.c:657:65: error: passing argument 2 of &#39;SetupDiGetClassDevsW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  657 |             SetupDiGetClassDevs(&amp;GUID_DEVINTERFACE_STORAGEPORT, parent_dev_id,<br>      |                                                                 ^~~~~~~~~~~~~<br>      |                                                                 |<br>      |                                                                 char *<br>In file included from ../qga/commands-win32.c:25:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/setupapi.h:1637:81: note: expected &#39;PCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1637 |   WINSETUPAPI HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *ClassGuid,PCWSTR Enumerator,HWND hwndParent,DWORD Flags);<br>      |                                                                          ~~~~~~~^~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;get_single_disk_info&#39;:<br>../qga/commands-win32.c:822:29: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  822 |     disk_h = CreateFile(disk-&gt;dev, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING,<br>      |                         ~~~~^~~~~<br>      |                             |<br>      |                             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;build_guest_disk_info&#39;:<br>../qga/commands-win32.c:891:24: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  891 |     vol_h = CreateFile(name, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING,<br>      |                        ^~~~<br>      |                        |<br>      |                        char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;build_guest_fsinfo&#39;:<br>../qga/commands-win32.c:1003:37: error: passing argument 1 of &#39;GetVolumePathNamesForVolumeNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&amp;mnt, 0, &amp;info_size);<br>      |                                     ^~~~<br>      |                                     |<br>      |                                     char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);<br>      |                                                               ~~~~~~~~^~~~~~~~~~~~~~<br>../qga/commands-win32.c:1003:43: error: passing argument 2 of &#39;GetVolumePathNamesForVolumeNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1003 |     GetVolumePathNamesForVolumeName(guid, (LPCH)&amp;mnt, 0, &amp;info_size);<br>      |                                           ^~~~~~~~~~<br>      |                                           |<br>      |                                           CHAR * {aka char *}<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93: note: expected &#39;LPWCH&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;CHAR *&#39; {aka &#39;char *&#39;}<br>   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);<br>      |                                                                                       ~~~~~~^~~~~~~~~~~~~~~~~~~<br>../qga/commands-win32.c:1010:42: error: passing argument 1 of &#39;GetVolumePathNamesForVolumeNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,<br>      |                                          ^~~~<br>      |                                          |<br>      |                                          char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:71: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);<br>      |                                                               ~~~~~~~~^~~~~~~~~~~~~~<br>../qga/commands-win32.c:1010:48: error: passing argument 2 of &#39;GetVolumePathNamesForVolumeNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1010 |     if (!GetVolumePathNamesForVolumeName(guid, mnt_point, info_size,<br>      |                                                ^~~~~~~~~<br>      |                                                |<br>      |                                                char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:98:93: note: expected &#39;LPWCH&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   98 |   WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);<br>      |                                                                                       ~~~~~~^~~~~~~~~~~~~~~~~~~<br>../qga/commands-win32.c:1016:35: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1016 |     hLocalDiskHandle = CreateFile(guid, 0 , 0, NULL, OPEN_EXISTING,<br>      |                                   ^~~~<br>      |                                   |<br>      |                                   char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>../qga/commands-win32.c:1045:34: error: passing argument 1 of &#39;GetDiskFreeSpaceExW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1045 |         if (GetDiskFreeSpaceEx(fs-&gt;mountpoint,<br>      |                                ~~^~~~~~~~~~~~<br>      |                                  |<br>      |                                  char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:174:58: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  174 |   WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);<br>      |                                                  ~~~~~~~~^~~~~~~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;qmp_guest_get_fsinfo&#39;:<br>../qga/commands-win32.c:1070:29: error: passing argument 1 of &#39;FindFirstVolumeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1070 |     vol_h = FindFirstVolume(guid, sizeof(guid));<br>      |                             ^~~~<br>      |                             |<br>      |                             char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:58:53: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   58 |   WINBASEAPI HANDLE WINAPI FindFirstVolumeW (LPWSTR lpszVolumeName, DWORD cchBufferLength);<br>      |                                              ~~~~~~~^~~~~~~~~~~~~~<br>../qga/commands-win32.c:1089:36: error: passing argument 2 of &#39;FindNextVolumeW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1089 |     } while (FindNextVolume(vol_h, guid, sizeof(guid)));<br>      |                                    ^~~~<br>      |                                    |<br>      |                                    char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:60:73: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   60 |   WINBASEAPI WINBOOL WINAPI FindNextVolumeW (HANDLE hFindVolume, LPWSTR lpszVolumeName, DWORD cchBufferLength);<br>      |                                                                  ~~~~~~~^~~~~~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;qmp_guest_suspend_disk&#39;:<br>../qga/commands-win32.c:1372:23: error: passing argument 1 of &#39;acquire_privilege&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1372 |     acquire_privilege(SE_SHUTDOWN_NAME, &amp;local_err);<br>      |                       ^~~~~~~~~~~~~~~~<br>      |                       |<br>      |                       const short unsigned int *<br>../qga/commands-win32.c:276:43: note: expected &#39;const char *&#39; but argument is of type &#39;const short unsigned int *&#39;<br>  276 | static void acquire_privilege(const char *name, Error **errp)<br>      |                               ~~~~~~~~~~~~^~~~<br>../qga/commands-win32.c: In function &#39;qmp_guest_suspend_ram&#39;:<br>../qga/commands-win32.c:1395:23: error: passing argument 1 of &#39;acquire_privilege&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1395 |     acquire_privilege(SE_SHUTDOWN_NAME, &amp;local_err);<br>      |                       ^~~~~~~~~~~~~~~~<br>      |                       |<br>      |                       const short unsigned int *<br>../qga/commands-win32.c:276:43: note: expected &#39;const char *&#39; but argument is of type &#39;const short unsigned int *&#39;<br>  276 | static void acquire_privilege(const char *name, Error **errp)<br>      |                               ~~~~~~~~~~~~^~~~<br>../qga/commands-win32.c: In function &#39;guest_addr_to_str&#39;:<br>../qga/commands-win32.c:1459:34: error: passing argument 4 of &#39;WSAAddressToStringW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1459 |                                  addr_str,<br>      |                                  ^~~~~~~~<br>      |                                  |<br>      |                                  char *<br>In file included from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:1086:141: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br> 1086 |   WINSOCK_API_LINKAGE INT WSAAPI WSAAddressToStringW(LPSOCKADDR lpsaAddress,DWORD dwAddressLength,LPWSAPROTOCOL_INFOW lpProtocolInfo,LPWSTR lpszAddressString,LPDWORD lpdwAddressStringLength);<br>      |                                                                                                                                      ~~~~~~~^~~~~~~~~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;guest_get_network_stats&#39;:<br>../qga/commands-win32.c:1509:42: error: passing argument 1 of &#39;GetModuleHandleW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1509 |         HMODULE module = GetModuleHandle(&quot;iphlpapi&quot;);<br>      |                                          ^~~~~~~~~~<br>      |                                          |<br>      |                                          const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);<br>      |                                             ~~~~~~~~^~~~~~~~~~~~<br>../qga/commands-win32.c: In function &#39;qmp_guest_set_time&#39;:<br>../qga/commands-win32.c:1686:24: error: passing argument 1 of &#39;strerror_s&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1686 |             strerror_s((LPTSTR) &amp; msg_buffer, 0, errno);<br>      |                        ^~~~~~~~~~~~~~~~~~~~~<br>      |                        |<br>      |                        WCHAR * {aka short unsigned int *}<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/string.h:190,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:87,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/sec_api/string_s.h:26:44: note: expected &#39;char *&#39; but argument is of type &#39;WCHAR *&#39; {aka &#39;short unsigned int *&#39;}<br>   26 |   _SECIMP errno_t __cdecl strerror_s(char *_Buf,size_t _SizeInBytes,int _ErrNum);<br>      |                                      ~~~~~~^~~~<br>In file included from ../qga/commands-win32.c:39:<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 6 has type &#39;const WCHAR *&#39; {aka &#39;const short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../qga/commands-win32.c:1687:13: note: in expansion of macro &#39;error_setg&#39;<br> 1687 |             error_setg(errp, &quot;system(...) failed: %s&quot;, (LPCTSTR)msg_buffer);<br>      |             ^~~~~~~~~~<br>C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39; expects argument of type &#39;char *&#39;, but argument 7 has type &#39;const WCHAR *&#39; {aka &#39;const short unsigned int *&#39;} [-Werror=format=]<br>  319 |                         (fmt), ## __VA_ARGS__)<br>      |                         ^~~~~<br>../qga/commands-win32.c:1702:21: note: in expansion of macro &#39;error_setg&#39;<br> 1702 |                     error_setg(errp, &quot;w32tm failed with error (0x%lx): %s&quot;, hr,<br>      |                     ^~~~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>../qga/commands-win32.c:1731:23: error: passing argument 1 of &#39;acquire_privilege&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 1731 |     acquire_privilege(SE_SYSTEMTIME_NAME, &amp;local_err);<br>      |                       ^~~~~~~~~~~~~~~~~~<br>      |                       |<br>      |                       const short unsigned int *<br>../qga/commands-win32.c:276:43: note: expected &#39;const char *&#39; but argument is of type &#39;const short unsigned int *&#39;<br>  276 | static void acquire_privilege(const char *name, Error **errp)<br>      |                               ~~~~~~~~~~~~^~~~<br>../qga/commands-win32.c: In function &#39;ga_get_win_version&#39;:<br>../qga/commands-win32.c:2119:38: error: passing argument 1 of &#39;GetModuleHandleW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br> 2119 |     HMODULE module = GetModuleHandle(&quot;ntdll&quot;);<br>      |                                      ^~~~~~~<br>      |                                      |<br>      |                                      const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../qga/commands-win32.c:13:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:140:53: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>  140 | WINBASEAPI HMODULE WINAPI GetModuleHandleW (LPCWSTR lpModuleName);<br>      |                                             ~~~~~~~~^~~~~~~~~~~~<br>make: [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1 (已忽略)<br>Linking static target libqemuutil.a<br><br>make[1]: 离开目录“/c/work/xemu/qemu/capstone”<br>&quot;C:/CI-Tools/msys64/mingw64/bin/python3.exe&quot; &quot;C:/work/xemu/qemu/meson/meson.py&quot; &quot;--internal&quot; &quot;exe&quot; &quot;--capture&quot; &quot;qemu-version.h&quot; &quot;--&quot; &quot;sh&quot; &quot;C:/work/xemu/qemu/scripts/qemu-version.sh&quot; &quot;C:/work/xemu/qemu&quot; &quot;&quot; &quot;5.1.50&quot; &amp;&amp; if test -e qemu-version.h; then printf &#39;%s\n&#39; qemu-version.h &gt; qemu-version.h.stamp; fi<br>&quot;cc&quot; &quot;-Ilibqemuutil.a.p&quot; &quot;-I.&quot; &quot;-I..&quot; &quot;-Iqapi&quot; &quot;-Itrace&quot; &quot;-Iui&quot; &quot;-Iui/shader&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include/glib-2.0&quot; &quot;-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include/p11-kit-1&quot; &quot;-fdiagnostics-color=auto&quot; &quot;-pipe&quot; &quot;-Wall&quot; &quot;-Winvalid-pch&quot; &quot;-Werror&quot; &quot;-std=gnu99&quot; &quot;-g&quot; &quot;-m64&quot; &quot;-mcx16&quot; &quot;-DUNICODE&quot; &quot;-D_UNICODE&quot; &quot;-D_GNU_SOURCE&quot; &quot;-D_FILE_OFFSET_BITS=64&quot; &quot;-D_LARGEFILE_SOURCE&quot; &quot;-Wstrict-prototypes&quot; &quot;-Wredundant-decls&quot; &quot;-Wundef&quot; &quot;-Wwrite-strings&quot; &quot;-Wmissing-prototypes&quot; &quot;-fno-strict-aliasing&quot; &quot;-fno-common&quot; &quot;-fwrapv&quot; &quot;-Wold-style-declaration&quot; &quot;-Wold-style-definition&quot; &quot;-Wtype-limits&quot; &quot;-Wformat-security&quot; &quot;-Wformat-y2k&quot; &quot;-Winit-self&quot; &quot;-Wignored-qualifiers&quot; &quot;-Wempty-body&quot; &quot;-Wnested-externs&quot; &quot;-Wendif-labels&quot; &quot;-Wexpansion-to-defined&quot; &quot;-Wno-missing-include-dirs&quot; &quot;-Wno-shift-negative-value&quot; &quot;-Wno-psabi&quot; &quot;-fstack-protector-strong&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/tcg/i386&quot; &quot;-iquote&quot; &quot;.&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/accel/tcg&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/include&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/disas/libvixl&quot; &quot;-pthread&quot; &quot;-mms-bitfields&quot; &quot;-mms-bitfields&quot; -MD -MQ libqemuutil.a.p/util_oslib-win32.c.obj -MF &quot;libqemuutil.a.p/util_oslib-win32.c.obj.d&quot; -o libqemuutil.a.p/util_oslib-win32.c.obj &quot;-c&quot; ../util/oslib-win32.c -MP<br>../util/oslib-win32.c: In function &#39;qemu_get_local_state_pathname&#39;:<br>../util/oslib-win32.c:289:58: error: passing argument 5 of &#39;SHGetFolderPathW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  289 |                              /* SHGFP_TYPE_CURRENT */ 0, base_path);<br>      |                                                          ^~~~~~~~~<br>      |                                                          |<br>      |                                                          char *<br>In file included from ../util/oslib-win32.c:44:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/shlobj.h:39:92: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>   39 |   SHFOLDERAPI SHGetFolderPathW (HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);<br>      |                                                                                     ~~~~~~~^~~~~~~<br>../util/oslib-win32.c: In function &#39;qemu_init_exec_dir&#39;:<br>../util/oslib-win32.c:327:35: error: passing argument 2 of &#39;GetModuleFileNameW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  327 |     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);<br>      |                                   ^~~<br>      |                                   |<br>      |                                   char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:24,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../util/oslib-win32.c:33:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/libloaderapi.h:153:71: note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of type &#39;char *&#39;<br>  153 |   WINBASEAPI DWORD WINAPI GetModuleFileNameW (HMODULE hModule, LPWSTR lpFilename, DWORD nSize);<br>      |                                                                ~~~~~~~^~~~~~~~~~<br>../util/oslib-win32.c: In function &#39;qemu_write_pidfile&#39;:<br>../util/oslib-win32.c:801:23: error: passing argument 1 of &#39;CreateFileW&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>  801 |     file = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,<br>      |                       ^~~~~~~~<br>      |                       |<br>      |                       const char *<br>In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winbase.h:18,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:70,<br>                 from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>                 from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>                 from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>                 from ../util/oslib-win32.c:33:<br>C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/fileapi.h:64:49: note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument is of type &#39;const char *&#39;<br>   64 |   WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);<br>      |                                         ~~~~~~~~^~~~~~~~~~<br>cc1.exe: all warnings being treated as errors<br>make: *** [Makefile.ninja:648:libqemuutil.a.p/util_oslib-win32.c.obj] 错误 1<br></div><div>```</div><div><br></div><div><br></div><div><br>&gt;<br>&gt; -- &gt;8 --<br>&gt; diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h<br>&gt; index 412962d91a2..cd5cedc0b21 100644<br>&gt; --- a/include/qemu/osdep.h<br>&gt; +++ b/include/qemu/osdep.h<br>&gt; @@ -74,6 +74,12 @@ extern int daemon(int, int);<br>&gt;  /* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */<br>&gt;  #ifdef __MINGW32__<br>&gt;  #define __USE_MINGW_ANSI_STDIO 1<br>&gt; +#ifndef UNICODE<br>&gt; +#define UNICODE<br>&gt; +#endif<br>&gt; +#ifndef _UNICODE<br>&gt; +#define _UNICODE<br>&gt; +#endif<br>&gt;  #endif<br>&gt;<br>&gt;  #include &lt;stdarg.h&gt;<br>&gt; ---<br>&gt;<br>&gt; &gt;    vhost_user=&quot;no&quot;<br>&gt; &gt;    audio_possible_drivers=&quot;dsound sdl&quot;<br>&gt; &gt;    if check_include dsound.h; then<br>&gt; &gt;<br>&gt;<br><br><br>--<br>         此致<br>礼<br>罗勇刚<br>Yours<br>    sincerely,<br>Yonggang Luo</div></div>
Philippe Mathieu-Daudé Sept. 15, 2020, 5:55 p.m. UTC | #3
On 9/15/20 7:41 PM, 罗勇刚(Yonggang Luo) wrote:
> On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé
> <philmd@redhat.com <mailto:philmd@redhat.com>> wrote:
>>
>> On 9/15/20 6:33 PM, Yonggang Luo wrote:
>> > error message:
>> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi"
> "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
> "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
> "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
> "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
> "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE"
> "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes"
> "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes"
> "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration"
> "-Wold-style-definition" "-Wtype-limits" "-Wformat-security"
> "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body"
> "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined"
> "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi"
> "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386"
> "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote"
> "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include"
> "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields"
> -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF
> "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
> qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
>> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of
> 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
>> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
>> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
>> > In file included from ../qga/commands-win32.c:26:
>> >
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
> note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
>> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST
> dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType,
> PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
>> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
>> > cc1.exe: all warnings being treated as errors
>> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj]
> 错误 1 (已忽略)
>> >
>> > This error comes from qemu configure didn't add predefined macro
> -DUNICODE -D_UNICODE in QEMU_CFLAGS,
>> > and these too macro are standard config for win32 if using windows
> wide api.
>> >
>> > in cfgmgr32.h
>> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
> const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
> PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
>> > #ifdef UNICODE
>> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
>> > #endif
>> >
>> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.
>> > and in win32, UNICODE and _UNICODE should be defined at the same time
>> >
>> > #endif
>> >
>> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com
> <mailto:luoyonggang@gmail.com>>
>> > ---
>> >  configure | 1 +
>> >  1 file changed, 1 insertion(+)
>> >
>> > diff --git a/configure b/configure
>> > index 9f141891ea..f5d661af4a 100755
>> > --- a/configure
>> > +++ b/configure
>> > @@ -812,6 +812,7 @@ MINGW32*)
>> >    mingw32="yes"
>> >    hax="yes"
>> >    whpx=""
>> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
>>
>> What about declaring them in include/qemu/osdep.h
>> instead?
> That's a good idea.
> But more compiling error warns me that the windows version of qemu are
> not in a good situation.

:)

> On Win32, all API should call the wide version so that support for
> Unicode properly.
> But obviously the currently qemu didn't do that
> 
> ```
[...]
> ../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
> C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> expects argument of type 'char *', but argument 6 has type 'WCHAR *'
> {aka 'short unsigned int *'} [-Werror=format=]
>   319 |                         (fmt), ## __VA_ARGS__)
>       |                         ^~~~~
> ../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
>  1235 |         error_setg(errp, "Cannot format numeric socket address: %s",
>       |         ^~~~~~~~~~
> In file included from ../io/dns-resolver.c:26:
> ../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
> C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> expects argument of type 'char *', but argument 8 has type 'WCHAR *'
> {aka 'short unsigned int *'} [-Werror=format=]
>   319 |                         (fmt), ## __VA_ARGS__)
>       |                         ^~~~~
> ../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
>    93 |         error_setg(errp, "address resolution failed for %s:%s: %s",
>       |         ^~~~~~~~~~
> cc1.exe: all warnings being treated as errors
> make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已
> 忽略)
> cc1.exe: all warnings being treated as errors
> make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误
> 1 (已忽略)
> Linking static target io/libio.fa
> C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj:
> No such file or directory
> make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
> ../net/tap-win32.c: In function 'is_tap_win32_dev':
> ../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>    62 | #define ADAPTER_KEY
> "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
>       |                    
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                     |
>       |                     const char *
> ../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
>    62 | #define ADAPTER_KEY
> "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
>       |                    
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
>                  from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
>                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
>                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
>                  from ../net/tap-win32.c:29:
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
> note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument
> is of type 'const char *'
>   195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
> lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
>       |                                                 ~~~~~~~~^~~~~~~~
> ../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>   229 |             enum_name,
>       |             ^~~~~~~~~
>       |             |
>       |             char *
> In file included from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
>                  from
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
>                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
>                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
>                  from ../net/tap-win32.c:29:
> C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
> note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
> type 'char *'
>   184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
> dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
> lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
>       |                                                              
> ~~~~~~~^~~~~~
> ../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
> from incompatible pointer type [-Werror=incompatible-pointer-types]
>   247 |             unit_string,
>       |             ^~~~~~~~~~~
>       |             |
>       |             char *

I'm not sure fixing all these warnings would produce a
maintainable code base. I'd rather disable these 2 warning
classes on Windows.
罗勇刚(Yonggang Luo) Sept. 15, 2020, 7:17 p.m. UTC | #4
On Wed, Sep 16, 2020 at 1:55 AM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:
>
> On 9/15/20 7:41 PM, 罗勇刚(Yonggang Luo) wrote:
> > On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé
> > <philmd@redhat.com <mailto:philmd@redhat.com>> wrote:
> >>
> >> On 9/15/20 6:33 PM, Yonggang Luo wrote:
> >> > error message:
> >> > "cc" "-Iqga/qemu-ga.exe.p" "-Iqga" "-I../qga" "-I." "-Iqapi"
> > "-Itrace" "-Iui" "-Iui/shader" "-IC:/CI-Tools/msys64/mingw64/include"
> > "-IC:/CI-Tools/msys64/mingw64/include/glib-2.0"
> > "-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include"
> > "-fdiagnostics-color=auto" "-pipe" "-Wall" "-Winvalid-pch" "-Werror"
> > "-std=gnu99" "-g" "-m64" "-mcx16" "-D_GNU_SOURCE"
> > "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-Wstrict-prototypes"
> > "-Wredundant-decls" "-Wundef" "-Wwrite-strings" "-Wmissing-prototypes"
> > "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wold-style-declaration"
> > "-Wold-style-definition" "-Wtype-limits" "-Wformat-security"
> > "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body"
> > "-Wnested-externs" "-Wendif-labels" "-Wexpansion-to-defined"
> > "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi"
> > "-fstack-protector-strong" "-iquote" "/c/work/xemu/qemu/tcg/i386"
> > "-iquote" "." "-iquote" "/c/work/xemu/qemu" "-iquote"
> > "/c/work/xemu/qemu/accel/tcg" "-iquote" "/c/work/xemu/qemu/include"
> > "-iquote" "/c/work/xemu/qemu/disas/libvixl" "-pthread" "-mms-bitfields"
> > -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF
> > "qga/qemu-ga.exe.p/commands-win32.c.obj.d" -o
> > qga/qemu-ga.exe.p/commands-win32.c.obj "-c" ../qga/commands-win32.c -MP
> >> > ../qga/commands-win32.c:62:24: error: redundant redeclaration of
> > 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
> >> >    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
> >> >       |                        ^~~~~~~~~~~~~~~~~~~~~~~~
> >> > In file included from ../qga/commands-win32.c:26:
> >> >
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:
> > note: previous declaration of 'CM_Get_DevNode_PropertyW' was here
> >> >   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST
> > dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType,
> > PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >> >       |                          ^~~~~~~~~~~~~~~~~~~~~~~~
> >> > cc1.exe: all warnings being treated as errors
> >> > make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj]
> > 错误 1 (已忽略)
> >> >
> >> > This error comes from qemu configure didn't add predefined macro
> > -DUNICODE -D_UNICODE in QEMU_CFLAGS,
> >> > and these too macro are standard config for win32 if using windows
> > wide api.
> >> >
> >> > in cfgmgr32.h
> >> >   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
> > const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
> > PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);
> >> > #ifdef UNICODE
> >> > #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
> >> > #endif
> >> >
> >> > macro CM_Get_DevNode_Property defined only when UNICODE are defined.
> >> > and in win32, UNICODE and _UNICODE should be defined at the same time
> >> >
> >> > #endif
> >> >
> >> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com
> > <mailto:luoyonggang@gmail.com>>
> >> > ---
> >> >  configure | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> > diff --git a/configure b/configure
> >> > index 9f141891ea..f5d661af4a 100755
> >> > --- a/configure
> >> > +++ b/configure
> >> > @@ -812,6 +812,7 @@ MINGW32*)
> >> >    mingw32="yes"
> >> >    hax="yes"
> >> >    whpx=""
> >> > +  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
> >>
> >> What about declaring them in include/qemu/osdep.h
> >> instead?
> > That's a good idea.
> > But more compiling error warns me that the windows version of qemu are
> > not in a good situation.
>
> :)
>
> > On Win32, all API should call the wide version so that support for
> > Unicode properly.
> > But obviously the currently qemu didn't do that
> >
> > ```
> [...]
> > ../util/qemu-sockets.c: In function 'socket_sockaddr_to_address_inet':
> > C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> > expects argument of type 'char *', but argument 6 has type 'WCHAR *'
> > {aka 'short unsigned int *'} [-Werror=format=]
> >   319 |                         (fmt), ## __VA_ARGS__)
> >       |                         ^~~~~
> > ../util/qemu-sockets.c:1235:9: note: in expansion of macro 'error_setg'
> >  1235 |         error_setg(errp, "Cannot format numeric socket address:
%s",
> >       |         ^~~~~~~~~~
> > In file included from ../io/dns-resolver.c:26:
> > ../io/dns-resolver.c: In function 'qio_dns_resolver_lookup_sync_inet':
> > C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format '%s'
> > expects argument of type 'char *', but argument 8 has type 'WCHAR *'
> > {aka 'short unsigned int *'} [-Werror=format=]
> >   319 |                         (fmt), ## __VA_ARGS__)
> >       |                         ^~~~~
> > ../io/dns-resolver.c:93:9: note: in expansion of macro 'error_setg'
> >    93 |         error_setg(errp, "address resolution failed for %s:%s:
%s",
> >       |         ^~~~~~~~~~
> > cc1.exe: all warnings being treated as errors
> > make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已
> > 忽略)
> > cc1.exe: all warnings being treated as errors
> > make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误
> > 1 (已忽略)
> > Linking static target io/libio.fa
> > C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj:
> > No such file or directory
> > make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)
> > ../net/tap-win32.c: In function 'is_tap_win32_dev':
> > ../net/tap-win32.c:62:21: error: passing argument 2 of 'RegOpenKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >    62 | #define ADAPTER_KEY
> >
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
> >       |
> >
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >       |                     |
> >       |                     const char *
> > ../net/tap-win32.c:62:21: note: in definition of macro 'ADAPTER_KEY'
> >    62 | #define ADAPTER_KEY
> >
"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
> >       |
> >
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > In file included from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
> >                  from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
> >                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
> >                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
> >                  from ../net/tap-win32.c:29:
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:
> > note: expected 'LPCWSTR' {aka 'const short unsigned int *'} but argument
> > is of type 'const char *'
> >   195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR
> > lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);
> >       |                                                 ~~~~~~~~^~~~~~~~
> > ../net/tap-win32.c:229:13: error: passing argument 3 of 'RegEnumKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   229 |             enum_name,
> >       |             ^~~~~~~~~
> >       |             |
> >       |             char *
> > In file included from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,
> >                  from
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
> >                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,
> >                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,
> >                  from ../net/tap-win32.c:29:
> > C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:
> > note: expected 'LPWSTR' {aka 'short unsigned int *'} but argument is of
> > type 'char *'
> >   184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD
> > dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR
> > lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);
> >       |
> > ~~~~~~~^~~~~~
> > ../net/tap-win32.c:247:13: error: passing argument 2 of 'RegOpenKeyExW'
> > from incompatible pointer type [-Werror=incompatible-pointer-types]
> >   247 |             unit_string,
> >       |             ^~~~~~~~~~~
> >       |             |
> >       |             char *
>
> I'm not sure fixing all these warnings would produce a
> maintainable code base. I'd rather disable these 2 warning
> classes on Windows.
I agree with that, seems QEMU currently are calling ANSI api all the time,
better not change that,
 so globally define -DUNICODE -D_UNICODE is not a option


--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo
<div dir="ltr"><br><br>On Wed, Sep 16, 2020 at 1:55 AM Philippe Mathieu-Daudé &lt;<a href="mailto:f4bug@amsat.org">f4bug@amsat.org</a>&gt; wrote:<br>&gt;<br>&gt; On 9/15/20 7:41 PM, 罗勇刚(Yonggang Luo) wrote:<br>&gt; &gt; On Wed, Sep 16, 2020 at 12:41 AM Philippe Mathieu-Daudé<br>&gt; &gt; &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a> &lt;mailto:<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt;&gt; wrote:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On 9/15/20 6:33 PM, Yonggang Luo wrote:<br>&gt; &gt;&gt; &gt; error message:<br>&gt; &gt;&gt; &gt; &quot;cc&quot; &quot;-Iqga/qemu-ga.exe.p&quot; &quot;-Iqga&quot; &quot;-I../qga&quot; &quot;-I.&quot; &quot;-Iqapi&quot;<br>&gt; &gt; &quot;-Itrace&quot; &quot;-Iui&quot; &quot;-Iui/shader&quot; &quot;-IC:/CI-Tools/msys64/mingw64/include&quot;<br>&gt; &gt; &quot;-IC:/CI-Tools/msys64/mingw64/include/glib-2.0&quot;<br>&gt; &gt; &quot;-IC:/CI-Tools/msys64/mingw64/lib/glib-2.0/include&quot;<br>&gt; &gt; &quot;-fdiagnostics-color=auto&quot; &quot;-pipe&quot; &quot;-Wall&quot; &quot;-Winvalid-pch&quot; &quot;-Werror&quot;<br>&gt; &gt; &quot;-std=gnu99&quot; &quot;-g&quot; &quot;-m64&quot; &quot;-mcx16&quot; &quot;-D_GNU_SOURCE&quot;<br>&gt; &gt; &quot;-D_FILE_OFFSET_BITS=64&quot; &quot;-D_LARGEFILE_SOURCE&quot; &quot;-Wstrict-prototypes&quot;<br>&gt; &gt; &quot;-Wredundant-decls&quot; &quot;-Wundef&quot; &quot;-Wwrite-strings&quot; &quot;-Wmissing-prototypes&quot;<br>&gt; &gt; &quot;-fno-strict-aliasing&quot; &quot;-fno-common&quot; &quot;-fwrapv&quot; &quot;-Wold-style-declaration&quot;<br>&gt; &gt; &quot;-Wold-style-definition&quot; &quot;-Wtype-limits&quot; &quot;-Wformat-security&quot;<br>&gt; &gt; &quot;-Wformat-y2k&quot; &quot;-Winit-self&quot; &quot;-Wignored-qualifiers&quot; &quot;-Wempty-body&quot;<br>&gt; &gt; &quot;-Wnested-externs&quot; &quot;-Wendif-labels&quot; &quot;-Wexpansion-to-defined&quot;<br>&gt; &gt; &quot;-Wno-missing-include-dirs&quot; &quot;-Wno-shift-negative-value&quot; &quot;-Wno-psabi&quot;<br>&gt; &gt; &quot;-fstack-protector-strong&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/tcg/i386&quot;<br>&gt; &gt; &quot;-iquote&quot; &quot;.&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu&quot; &quot;-iquote&quot;<br>&gt; &gt; &quot;/c/work/xemu/qemu/accel/tcg&quot; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/include&quot;<br>&gt; &gt; &quot;-iquote&quot; &quot;/c/work/xemu/qemu/disas/libvixl&quot; &quot;-pthread&quot; &quot;-mms-bitfields&quot;<br>&gt; &gt; -MD -MQ qga/qemu-ga.exe.p/commands-win32.c.obj -MF<br>&gt; &gt; &quot;qga/qemu-ga.exe.p/commands-win32.c.obj.d&quot; -o<br>&gt; &gt; qga/qemu-ga.exe.p/commands-win32.c.obj &quot;-c&quot; ../qga/commands-win32.c -MP<br>&gt; &gt;&gt; &gt; ../qga/commands-win32.c:62:24: error: redundant redeclaration of<br>&gt; &gt; &#39;CM_Get_DevNode_PropertyW&#39; [-Werror=redundant-decls]<br>&gt; &gt;&gt; &gt;    62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(<br>&gt; &gt;&gt; &gt;       |                        ^~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt;&gt; &gt; In file included from ../qga/commands-win32.c:26:<br>&gt; &gt;&gt; &gt;<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26:<br>&gt; &gt; note: previous declaration of &#39;CM_Get_DevNode_PropertyW&#39; was here<br>&gt; &gt;&gt; &gt;   840 |   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST<br>&gt; &gt; dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType,<br>&gt; &gt; PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);<br>&gt; &gt;&gt; &gt;       |                          ^~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt;&gt; &gt; cc1.exe: all warnings being treated as errors<br>&gt; &gt;&gt; &gt; make: [Makefile.ninja:5143:qga/qemu-ga.exe.p/commands-win32.c.obj]<br>&gt; &gt; 错误 1 (已忽略)<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; This error comes from qemu configure didn&#39;t add predefined macro<br>&gt; &gt; -DUNICODE -D_UNICODE in QEMU_CFLAGS,<br>&gt; &gt;&gt; &gt; and these too macro are standard config for win32 if using windows<br>&gt; &gt; wide api.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; in cfgmgr32.h<br>&gt; &gt;&gt; &gt;   CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,<br>&gt; &gt; const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE<br>&gt; &gt; PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags);<br>&gt; &gt;&gt; &gt; #ifdef UNICODE<br>&gt; &gt;&gt; &gt; #define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW<br>&gt; &gt;&gt; &gt; #endif<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; macro CM_Get_DevNode_Property defined only when UNICODE are defined.<br>&gt; &gt;&gt; &gt; and in win32, UNICODE and _UNICODE should be defined at the same time<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; #endif<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Signed-off-by: Yonggang Luo &lt;<a href="mailto:luoyonggang@gmail.com">luoyonggang@gmail.com</a><br>&gt; &gt; &lt;mailto:<a href="mailto:luoyonggang@gmail.com">luoyonggang@gmail.com</a>&gt;&gt;<br>&gt; &gt;&gt; &gt; ---<br>&gt; &gt;&gt; &gt;  configure | 1 +<br>&gt; &gt;&gt; &gt;  1 file changed, 1 insertion(+)<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; diff --git a/configure b/configure<br>&gt; &gt;&gt; &gt; index 9f141891ea..f5d661af4a 100755<br>&gt; &gt;&gt; &gt; --- a/configure<br>&gt; &gt;&gt; &gt; +++ b/configure<br>&gt; &gt;&gt; &gt; @@ -812,6 +812,7 @@ MINGW32*)<br>&gt; &gt;&gt; &gt;    mingw32=&quot;yes&quot;<br>&gt; &gt;&gt; &gt;    hax=&quot;yes&quot;<br>&gt; &gt;&gt; &gt;    whpx=&quot;&quot;<br>&gt; &gt;&gt; &gt; +  QEMU_CFLAGS=&quot;-DUNICODE -D_UNICODE $QEMU_CFLAGS&quot;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; What about declaring them in include/qemu/osdep.h<br>&gt; &gt;&gt; instead?<br>&gt; &gt; That&#39;s a good idea.<br>&gt; &gt; But more compiling error warns me that the windows version of qemu are<br>&gt; &gt; not in a good situation.<br>&gt;<br>&gt; :)<br>&gt;<br>&gt; &gt; On Win32, all API should call the wide version so that support for<br>&gt; &gt; Unicode properly.<br>&gt; &gt; But obviously the currently qemu didn&#39;t do that<br>&gt; &gt;<br>&gt; &gt; ```<br>&gt; [...]<br>&gt; &gt; ../util/qemu-sockets.c: In function &#39;socket_sockaddr_to_address_inet&#39;:<br>&gt; &gt; C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39;<br>&gt; &gt; expects argument of type &#39;char *&#39;, but argument 6 has type &#39;WCHAR *&#39;<br>&gt; &gt; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>&gt; &gt;   319 |                         (fmt), ## __VA_ARGS__)<br>&gt; &gt;       |                         ^~~~~<br>&gt; &gt; ../util/qemu-sockets.c:1235:9: note: in expansion of macro &#39;error_setg&#39;<br>&gt; &gt;  1235 |         error_setg(errp, &quot;Cannot format numeric socket address: %s&quot;,<br>&gt; &gt;       |         ^~~~~~~~~~<br>&gt; &gt; In file included from ../io/dns-resolver.c:26:<br>&gt; &gt; ../io/dns-resolver.c: In function &#39;qio_dns_resolver_lookup_sync_inet&#39;:<br>&gt; &gt; C:/work/xemu/qemu/include/qapi/error.h:319:25: error: format &#39;%s&#39;<br>&gt; &gt; expects argument of type &#39;char *&#39;, but argument 8 has type &#39;WCHAR *&#39;<br>&gt; &gt; {aka &#39;short unsigned int *&#39;} [-Werror=format=]<br>&gt; &gt;   319 |                         (fmt), ## __VA_ARGS__)<br>&gt; &gt;       |                         ^~~~~<br>&gt; &gt; ../io/dns-resolver.c:93:9: note: in expansion of macro &#39;error_setg&#39;<br>&gt; &gt;    93 |         error_setg(errp, &quot;address resolution failed for %s:%s: %s&quot;,<br>&gt; &gt;       |         ^~~~~~~~~~<br>&gt; &gt; cc1.exe: all warnings being treated as errors<br>&gt; &gt; make: [Makefile.ninja:756:io/libio.fa.p/dns-resolver.c.obj] 错误 1 (已<br>&gt; &gt; 忽略)<br>&gt; &gt; cc1.exe: all warnings being treated as errors<br>&gt; &gt; make: [Makefile.ninja:697:libqemuutil.a.p/util_qemu-sockets.c.obj] 错误<br>&gt; &gt; 1 (已忽略)<br>&gt; &gt; Linking static target io/libio.fa<br>&gt; &gt; C:\CI-Tools\msys64\mingw64\bin\ar.exe: io/libio.fa.p/dns-resolver.c.obj:<br>&gt; &gt; No such file or directory<br>&gt; &gt; make: [Makefile.ninja:764:io/libio.fa] 错误 1 (已忽略)<br>&gt; &gt; ../net/tap-win32.c: In function &#39;is_tap_win32_dev&#39;:<br>&gt; &gt; ../net/tap-win32.c:62:21: error: passing argument 2 of &#39;RegOpenKeyExW&#39;<br>&gt; &gt; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>&gt; &gt;    62 | #define ADAPTER_KEY<br>&gt; &gt; &quot;SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>&gt; &gt;       |                    <br>&gt; &gt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt;       |                     |<br>&gt; &gt;       |                     const char *<br>&gt; &gt; ../net/tap-win32.c:62:21: note: in definition of macro &#39;ADAPTER_KEY&#39;<br>&gt; &gt;    62 | #define ADAPTER_KEY<br>&gt; &gt; &quot;SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}&quot;<br>&gt; &gt;       |                    <br>&gt; &gt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>&gt; &gt; In file included from<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>&gt; &gt;                  from<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>&gt; &gt;                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>&gt; &gt;                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>&gt; &gt;                  from ../net/tap-win32.c:29:<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:195:57:<br>&gt; &gt; note: expected &#39;LPCWSTR&#39; {aka &#39;const short unsigned int *&#39;} but argument<br>&gt; &gt; is of type &#39;const char *&#39;<br>&gt; &gt;   195 |   WINADVAPI LONG WINAPI RegOpenKeyExW(HKEY hKey,LPCWSTR<br>&gt; &gt; lpSubKey,DWORD ulOptions,REGSAM samDesired,PHKEY phkResult);<br>&gt; &gt;       |                                                 ~~~~~~~~^~~~~~~~<br>&gt; &gt; ../net/tap-win32.c:229:13: error: passing argument 3 of &#39;RegEnumKeyExW&#39;<br>&gt; &gt; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>&gt; &gt;   229 |             enum_name,<br>&gt; &gt;       |             ^~~~~~~~~<br>&gt; &gt;       |             |<br>&gt; &gt;       |             char *<br>&gt; &gt; In file included from<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:76,<br>&gt; &gt;                  from<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,<br>&gt; &gt;                  from C:/work/xemu/qemu/include/sysemu/os-win32.h:29,<br>&gt; &gt;                  from C:/work/xemu/qemu/include/qemu/osdep.h:119,<br>&gt; &gt;                  from ../net/tap-win32.c:29:<br>&gt; &gt; C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/winreg.h:184:70:<br>&gt; &gt; note: expected &#39;LPWSTR&#39; {aka &#39;short unsigned int *&#39;} but argument is of<br>&gt; &gt; type &#39;char *&#39;<br>&gt; &gt;   184 |   WINADVAPI LONG WINAPI RegEnumKeyExW(HKEY hKey,DWORD<br>&gt; &gt; dwIndex,LPWSTR lpName,LPDWORD lpcchName,LPDWORD lpReserved,LPWSTR<br>&gt; &gt; lpClass,LPDWORD lpcchClass,PFILETIME lpftLastWriteTime);<br>&gt; &gt;       |                                                              <br>&gt; &gt; ~~~~~~~^~~~~~<br>&gt; &gt; ../net/tap-win32.c:247:13: error: passing argument 2 of &#39;RegOpenKeyExW&#39;<br>&gt; &gt; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>&gt; &gt;   247 |             unit_string,<br>&gt; &gt;       |             ^~~~~~~~~~~<br>&gt; &gt;       |             |<br>&gt; &gt;       |             char *<br>&gt;<br>&gt; I&#39;m not sure fixing all these warnings would produce a<br>&gt; maintainable code base. I&#39;d rather disable these 2 warning<br>&gt; classes on Windows.<br>I agree with that, seems QEMU currently are calling ANSI api all the time, better not change that,<div> so globally define

-DUNICODE -D_UNICODE is not a option<br><br><br>--<br>         此致<br>礼<br>罗勇刚<br>Yours<br>    sincerely,<br>Yonggang Luo</div></div>
Thomas Huth Sept. 16, 2020, 6:47 a.m. UTC | #5
On 15/09/2020 21.17, 罗勇刚(Yonggang Luo) wrote:

> I agree with that, seems QEMU currently are calling ANSI api all the

> time, better not change that,

>  so globally define -DUNICODE -D_UNICODE is not a option


I agree, -DUNICODE is currently not an option. I'll go with my patch
("qga/commands-win32: Fix problem with redundant protype declaration")
for the time being, until someone found a nicer solution that works.

 Thomas
diff mbox series

Patch

diff --git a/configure b/configure
index 9f141891ea..f5d661af4a 100755
--- a/configure
+++ b/configure
@@ -812,6 +812,7 @@  MINGW32*)
   mingw32="yes"
   hax="yes"
   whpx=""
+  QEMU_CFLAGS="-DUNICODE -D_UNICODE $QEMU_CFLAGS"
   vhost_user="no"
   audio_possible_drivers="dsound sdl"
   if check_include dsound.h; then