All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++
@ 2022-03-16 13:54 Helge Konetzka
  2022-04-05  5:34 ` ping " Helge Konetzka
  2022-04-05  8:27 ` Konstantin Kostiuk
  0 siblings, 2 replies; 3+ messages in thread
From: Helge Konetzka @ 2022-03-16 13:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: Konstantin Kostiuk, Philippe Mathieu-Daudé,
	Marc-André Lureau, Michael Roth

This fixes:

qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
type 'char *' with an rvalue of type 'const char *'
     char *msg = NULL, *nul = strchr(text, '(');
                        ^     ~~~~~~~~~~~~~~~~~

Signed-off-by: Helge Konetzka <hk@zapateado.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Compiling with clang++ of msys2 toolchain clang64 leads to

[1445/1747] Compiling C++ object qga/vss-win32/qga-vss.dll.p/install.cpp.obj
FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
...
qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of 
type 'char *' with an rvalue of type 'const char *'
     char *msg = NULL, *nul = strchr(text, '(');
                        ^     ~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
make: *** [Makefile:163: run-ninja] Error 1
==> ERROR: A failure occurred in build().
     Aborting...
---
  qga/vss-win32/install.cpp | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index 8076efe3cb..b57508fbe0 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -46,7 +46,8 @@ void errmsg(DWORD err, const char *text)
       * If text doesn't contains '(', negative precision is given, which is
       * treated as though it were missing.
       */
-    char *msg = NULL, *nul = strchr(text, '(');
+    char *msg = NULL;
+    const char *nul = strchr(text, '(');
      int len = nul ? nul - text : -1;

      FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: ping [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++
  2022-03-16 13:54 [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++ Helge Konetzka
@ 2022-04-05  5:34 ` Helge Konetzka
  2022-04-05  8:27 ` Konstantin Kostiuk
  1 sibling, 0 replies; 3+ messages in thread
From: Helge Konetzka @ 2022-04-05  5:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Konstantin Kostiuk, Philippe Mathieu-Daudé,
	Marc-André Lureau, Michael Roth

ping

https://lore.kernel.org/qemu-devel/39400817-3dc9-516d-9096-bc1f68862531@zapateado.de/
https://patchew.org/QEMU/39400817-3dc9-516d-9096-bc1f68862531@zapateado.de/

Am 16.03.22 um 14:54 schrieb Helge Konetzka:
> This fixes:
> 
> qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
> type 'char *' with an rvalue of type 'const char *'
>      char *msg = NULL, *nul = strchr(text, '(');
>                         ^     ~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Helge Konetzka <hk@zapateado.de>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Compiling with clang++ of msys2 toolchain clang64 leads to
> 
> [1445/1747] Compiling C++ object 
> qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> ...
> qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of 
> type 'char *' with an rvalue of type 'const char *'
>      char *msg = NULL, *nul = strchr(text, '(');
>                         ^     ~~~~~~~~~~~~~~~~~
> 1 error generated.
> ninja: build stopped: subcommand failed.
> make: *** [Makefile:163: run-ninja] Error 1
> ==> ERROR: A failure occurred in build().
>      Aborting...
> ---
>   qga/vss-win32/install.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
> index 8076efe3cb..b57508fbe0 100644
> --- a/qga/vss-win32/install.cpp
> +++ b/qga/vss-win32/install.cpp
> @@ -46,7 +46,8 @@ void errmsg(DWORD err, const char *text)
>        * If text doesn't contains '(', negative precision is given, 
> which is
>        * treated as though it were missing.
>        */
> -    char *msg = NULL, *nul = strchr(text, '(');
> +    char *msg = NULL;
> +    const char *nul = strchr(text, '(');
>       int len = nul ? nul - text : -1;
> 
>       FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++
  2022-03-16 13:54 [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++ Helge Konetzka
  2022-04-05  5:34 ` ping " Helge Konetzka
@ 2022-04-05  8:27 ` Konstantin Kostiuk
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin Kostiuk @ 2022-04-05  8:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Helge Konetzka,
	Philippe Mathieu-Daudé,
	Michael Roth

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Wed, Mar 16, 2022 at 3:58 PM Helge Konetzka <hk@zapateado.de> wrote:

> This fixes:
>
> qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
> type 'char *' with an rvalue of type 'const char *'
>      char *msg = NULL, *nul = strchr(text, '(');
>                         ^     ~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Helge Konetzka <hk@zapateado.de>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Compiling with clang++ of msys2 toolchain clang64 leads to
>
> [1445/1747] Compiling C++ object
> qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> ...
> qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
> type 'char *' with an rvalue of type 'const char *'
>      char *msg = NULL, *nul = strchr(text, '(');
>                         ^     ~~~~~~~~~~~~~~~~~
> 1 error generated.
> ninja: build stopped: subcommand failed.
> make: *** [Makefile:163: run-ninja] Error 1
> ==> ERROR: A failure occurred in build().
>      Aborting...
> ---
>   qga/vss-win32/install.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
> index 8076efe3cb..b57508fbe0 100644
> --- a/qga/vss-win32/install.cpp
> +++ b/qga/vss-win32/install.cpp
> @@ -46,7 +46,8 @@ void errmsg(DWORD err, const char *text)
>        * If text doesn't contains '(', negative precision is given, which
> is
>        * treated as though it were missing.
>        */
> -    char *msg = NULL, *nul = strchr(text, '(');
> +    char *msg = NULL;
> +    const char *nul = strchr(text, '(');
>       int len = nul ? nul - text : -1;
>
>       FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
> --
> 2.30.2
>
>

[-- Attachment #2: Type: text/html, Size: 2693 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-05  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16 13:54 [PATCH-for-7.0 v2] qga/vss-win32: fix compilation with clang++ Helge Konetzka
2022-04-05  5:34 ` ping " Helge Konetzka
2022-04-05  8:27 ` Konstantin Kostiuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.