* [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN"
@ 2023-03-18 18:59 Bernhard Beschow
2023-03-18 20:23 ` Bernhard Beschow
2023-03-19 16:42 ` Peter Maydell
0 siblings, 2 replies; 4+ messages in thread
From: Bernhard Beschow @ 2023-03-18 18:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Bernhard Beschow
Fixes the Windows build under msys2 using GCC 12 which fails with the following
error:
[184/579] Compiling C++ object qga/vss-win32/qga-vss.dll.p/install.cpp.obj
FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
"c++" "-m64" "-mcx16" "-Iqga/vss-win32/qga-vss.dll.p" "-Iqga/vss-win32" "-I../src/qga/vss-win32" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Werror" "-std=gnu++11" "-g" "-iquote" "." "-iquote" "C:/msys64/home/shentey/Projects/qemu/src" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/include" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/tcg/i386" "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-fno-pie" "-no-pie" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wundef" "-Wwrite-strings" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wendif-labels" "-Wexpansion-to-defined" "-Wimplicit-fallthrough=2" "-Wmissing-format-attribute" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-Wno-unknown-pragmas" "-Wno-delete-non-virtual-dtor" "-Wno-non-virtual-dtor" -MD -MQ qga/vss-win32/qga-vss.dll.p/install.cpp.obj -MF "qga/vss-win32/qga-vss.dll.p/install.cpp.obj.d" -o qga/vss-win32/qga-vss.dll.p/install.cpp.obj "-c" ../src/qga/vss-win32/install.cpp
In file included from C:/msys64/mingw64/lib/glib-2.0/include/glibconfig.h:9,
from C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:34,
from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:34,
from C:/msys64/mingw64/include/glib-2.0/glib.h:32,
from C:/msys64/home/shentey/Projects/qemu/src/include/glib-compat.h:32,
from C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:144,
from ../src/qga/vss-win32/install.cpp:13:
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
1075 | # define G_NORETURN [[noreturn]]
| ^
C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
240 | extern G_NORETURN
| ^~~~~~~~~~
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: standard attributes must precede the decl-specifiers to apply to the declaration, or follow them to apply to the type
1075 | # define G_NORETURN [[noreturn]]
| ^
C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
240 | extern G_NORETURN
| ^~~~~~~~~~
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: attribute ignored [-Werror=attributes]
1075 | # define G_NORETURN [[noreturn]]
| ^
C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
240 | extern G_NORETURN
| ^~~~~~~~~~
C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: an attribute that appertains to a type-specifier is ignored
1075 | # define G_NORETURN [[noreturn]]
| ^
C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
240 | extern G_NORETURN
| ^~~~~~~~~~
cc1plus.exe: all warnings being treated as errors
Apparently it also fixes the compilation with Clang 15 (see
https://gitlab.com/qemu-project/qemu/-/issues/1541 ).
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/qemu/osdep.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index f68b5d8708..9eff0be95b 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -237,7 +237,7 @@ extern "C" {
* supports QEMU_ERROR, this will be reported at compile time; otherwise
* this will be reported at link time due to the missing symbol.
*/
-extern G_NORETURN
+G_NORETURN extern
void QEMU_ERROR("code path is reachable")
qemu_build_not_reached_always(void);
#if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
--
2.40.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN"
2023-03-18 18:59 [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN" Bernhard Beschow
@ 2023-03-18 20:23 ` Bernhard Beschow
2023-03-20 8:35 ` Thomas Huth
2023-03-19 16:42 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Bernhard Beschow @ 2023-03-18 20:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, berrange, Stefan Weil
+ Thomas, Daniel (gitlab issue) and Stefan (Windows)
Am 18. März 2023 18:59:31 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
>Fixes the Windows build under msys2 using GCC 12 which fails with the following
>error:
>
> [184/579] Compiling C++ object qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
> "c++" "-m64" "-mcx16" "-Iqga/vss-win32/qga-vss.dll.p" "-Iqga/vss-win32" "-I../src/qga/vss-win32" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Werror" "-std=gnu++11" "-g" "-iquote" "." "-iquote" "C:/msys64/home/shentey/Projects/qemu/src" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/include" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/tcg/i386" "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-fno-pie" "-no-pie" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wundef" "-Wwrite-strings" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wendif-labels" "-Wexpansion-to-defined" "-Wimplicit-fallthrough=2" "-Wmissing-format-attribute" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-Wno-unknown-pragmas" "-Wno-delete-non-virtual-dtor" "-Wno-non-virtual-dtor" -MD -MQ qga/vss-win32/qga-vss.dll.p/install.cpp.obj -MF "qga/vss-win32/qga-vss.dll.p/install.cpp.obj.d" -o qga/vss-win32/qga-vss.dll.p/install.cpp.obj "-c" ../src/qga/vss-win32/install.cpp
> In file included from C:/msys64/mingw64/lib/glib-2.0/include/glibconfig.h:9,
> from C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:34,
> from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:34,
> from C:/msys64/mingw64/include/glib-2.0/glib.h:32,
> from C:/msys64/home/shentey/Projects/qemu/src/include/glib-compat.h:32,
> from C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:144,
> from ../src/qga/vss-win32/install.cpp:13:
> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
> 1075 | # define G_NORETURN [[noreturn]]
> | ^
> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
> 240 | extern G_NORETURN
> | ^~~~~~~~~~
> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: standard attributes must precede the decl-specifiers to apply to the declaration, or follow them to apply to the type
> 1075 | # define G_NORETURN [[noreturn]]
> | ^
> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
> 240 | extern G_NORETURN
> | ^~~~~~~~~~
> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: attribute ignored [-Werror=attributes]
> 1075 | # define G_NORETURN [[noreturn]]
> | ^
> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
> 240 | extern G_NORETURN
> | ^~~~~~~~~~
> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: an attribute that appertains to a type-specifier is ignored
> 1075 | # define G_NORETURN [[noreturn]]
> | ^
> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
> 240 | extern G_NORETURN
> | ^~~~~~~~~~
> cc1plus.exe: all warnings being treated as errors
>
>Apparently it also fixes the compilation with Clang 15 (see
>https://gitlab.com/qemu-project/qemu/-/issues/1541 ).
>
>Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>---
> include/qemu/osdep.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
>index f68b5d8708..9eff0be95b 100644
>--- a/include/qemu/osdep.h
>+++ b/include/qemu/osdep.h
>@@ -237,7 +237,7 @@ extern "C" {
> * supports QEMU_ERROR, this will be reported at compile time; otherwise
> * this will be reported at link time due to the missing symbol.
> */
>-extern G_NORETURN
>+G_NORETURN extern
> void QEMU_ERROR("code path is reachable")
> qemu_build_not_reached_always(void);
> #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN"
2023-03-18 18:59 [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN" Bernhard Beschow
2023-03-18 20:23 ` Bernhard Beschow
@ 2023-03-19 16:42 ` Peter Maydell
1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2023-03-19 16:42 UTC (permalink / raw)
To: Bernhard Beschow; +Cc: qemu-devel
On Sat, 18 Mar 2023 at 19:00, Bernhard Beschow <shentey@gmail.com> wrote:
>
> Fixes the Windows build under msys2 using GCC 12 which fails with the following
> error:
Apparently it also fixes the compilation with Clang 15 (see
https://gitlab.com/qemu-project/qemu/-/issues/1541 ).
You could use a Resolves: tag so the bug gets closed when
this is applied.
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index f68b5d8708..9eff0be95b 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -237,7 +237,7 @@ extern "C" {
> * supports QEMU_ERROR, this will be reported at compile time; otherwise
> * this will be reported at link time due to the missing symbol.
> */
> -extern G_NORETURN
> +G_NORETURN extern
> void QEMU_ERROR("code path is reachable")
> qemu_build_not_reached_always(void);
> #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
> --
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN"
2023-03-18 20:23 ` Bernhard Beschow
@ 2023-03-20 8:35 ` Thomas Huth
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2023-03-20 8:35 UTC (permalink / raw)
To: Bernhard Beschow, qemu-devel; +Cc: berrange, Stefan Weil
On 18/03/2023 21.23, Bernhard Beschow wrote:
> + Thomas, Daniel (gitlab issue) and Stefan (Windows)
Thanks, I'll pick the patch for my next pull request.
Thomas
> Am 18. März 2023 18:59:31 UTC schrieb Bernhard Beschow <shentey@gmail.com>:
>> Fixes the Windows build under msys2 using GCC 12 which fails with the following
>> error:
>>
>> [184/579] Compiling C++ object qga/vss-win32/qga-vss.dll.p/install.cpp.obj
>> FAILED: qga/vss-win32/qga-vss.dll.p/install.cpp.obj
>> "c++" "-m64" "-mcx16" "-Iqga/vss-win32/qga-vss.dll.p" "-Iqga/vss-win32" "-I../src/qga/vss-win32" "-I." "-Iqapi" "-Itrace" "-Iui" "-Iui/shader" "-IC:/msys64/mingw64/include/glib-2.0" "-IC:/msys64/mingw64/lib/glib-2.0/include" "-fdiagnostics-color=auto" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Werror" "-std=gnu++11" "-g" "-iquote" "." "-iquote" "C:/msys64/home/shentey/Projects/qemu/src" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/include" "-iquote" "C:/msys64/home/shentey/Projects/qemu/src/tcg/i386" "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-fno-pie" "-no-pie" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-D_LARGEFILE_SOURCE" "-fno-strict-aliasing" "-fno-common" "-fwrapv" "-Wundef" "-Wwrite-strings" "-Wtype-limits" "-Wformat-security" "-Wformat-y2k" "-Winit-self" "-Wignored-qualifiers" "-Wempty-body" "-Wendif-labels" "-Wexpansion-to-defined" "-Wimplicit-fallthrough=2" "-Wmissing-format-attribute" "-Wno-missing-include-dirs" "-Wno-shift-negative-value" "-Wno-psabi" "-fstack-protector-strong" "-Wno-unknown-pragmas" "-Wno-delete-non-virtual-dtor" "-Wno-non-virtual-dtor" -MD -MQ qga/vss-win32/qga-vss.dll.p/install.cpp.obj -MF "qga/vss-win32/qga-vss.dll.p/install.cpp.obj.d" -o qga/vss-win32/qga-vss.dll.p/install.cpp.obj "-c" ../src/qga/vss-win32/install.cpp
>> In file included from C:/msys64/mingw64/lib/glib-2.0/include/glibconfig.h:9,
>> from C:/msys64/mingw64/include/glib-2.0/glib/gtypes.h:34,
>> from C:/msys64/mingw64/include/glib-2.0/glib/galloca.h:34,
>> from C:/msys64/mingw64/include/glib-2.0/glib.h:32,
>> from C:/msys64/home/shentey/Projects/qemu/src/include/glib-compat.h:32,
>> from C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:144,
>> from ../src/qga/vss-win32/install.cpp:13:
>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: standard attributes in middle of decl-specifiers
>> 1075 | # define G_NORETURN [[noreturn]]
>> | ^
>> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
>> 240 | extern G_NORETURN
>> | ^~~~~~~~~~
>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: standard attributes must precede the decl-specifiers to apply to the declaration, or follow them to apply to the type
>> 1075 | # define G_NORETURN [[noreturn]]
>> | ^
>> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
>> 240 | extern G_NORETURN
>> | ^~~~~~~~~~
>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: error: attribute ignored [-Werror=attributes]
>> 1075 | # define G_NORETURN [[noreturn]]
>> | ^
>> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
>> 240 | extern G_NORETURN
>> | ^~~~~~~~~~
>> C:/msys64/mingw64/include/glib-2.0/glib/gmacros.h:1075:21: note: an attribute that appertains to a type-specifier is ignored
>> 1075 | # define G_NORETURN [[noreturn]]
>> | ^
>> C:/msys64/home/shentey/Projects/qemu/src/include/qemu/osdep.h:240:8: note: in expansion of macro 'G_NORETURN'
>> 240 | extern G_NORETURN
>> | ^~~~~~~~~~
>> cc1plus.exe: all warnings being treated as errors
>>
>> Apparently it also fixes the compilation with Clang 15 (see
>> https://gitlab.com/qemu-project/qemu/-/issues/1541 ).
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>> include/qemu/osdep.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
>> index f68b5d8708..9eff0be95b 100644
>> --- a/include/qemu/osdep.h
>> +++ b/include/qemu/osdep.h
>> @@ -237,7 +237,7 @@ extern "C" {
>> * supports QEMU_ERROR, this will be reported at compile time; otherwise
>> * this will be reported at link time due to the missing symbol.
>> */
>> -extern G_NORETURN
>> +G_NORETURN extern
>> void QEMU_ERROR("code path is reachable")
>> qemu_build_not_reached_always(void);
>> #if defined(__OPTIMIZE__) && !defined(__NO_INLINE__)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-20 8:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-18 18:59 [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN" Bernhard Beschow
2023-03-18 20:23 ` Bernhard Beschow
2023-03-20 8:35 ` Thomas Huth
2023-03-19 16:42 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).