From patchwork Sat Mar 18 18:59:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13179935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C504C74A5B for ; Sat, 18 Mar 2023 19:00:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdbmK-0003SC-Qw; Sat, 18 Mar 2023 14:59:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pdbmJ-0003RU-Pm for qemu-devel@nongnu.org; Sat, 18 Mar 2023 14:59:43 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdbmH-0003Gi-Sg for qemu-devel@nongnu.org; Sat, 18 Mar 2023 14:59:43 -0400 Received: by mail-ed1-x532.google.com with SMTP id w9so32474162edc.3 for ; Sat, 18 Mar 2023 11:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679165979; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AvDObqajYMLVke1+6o7AO8CeVOhoT1kOGwUbTCe5ys8=; b=pcfUTJ8jFpNfOjCXXdQbMbkcwyTQ0nwn4wQHXY4JsR37YFxKt0Pe+lXgmv/Cm/mpld Ap/ppZnheMwQD3w0zBBnUS5LJLxvVRj/CsnbhJmwj2sQwIqxEKmyynX1MKN51HvI7XYr VJt5Qg4hiU3AZT9/ROmFrDhUl0fjIGdDxktdBQLuog9mSUickCKvraVBXHKPm3NwkNth Mr8HhsdixqBmnxynKEu+jN9xpijtgmxhwidVy3OYL9eXj1GiF6jR/ciMenOAR53CFiKI 4hEI3nN+ZBNWaNVgLK2voGtJ2SwdqnlL77HR8w91h7h4C6RatX3r7ZS2J0gY08HPcpJt WFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679165979; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AvDObqajYMLVke1+6o7AO8CeVOhoT1kOGwUbTCe5ys8=; b=Dht/ibAMrtUPFzDALES23/qxTUa4Ba/eh47hwXff4PnqnkLTVJEXM+01h2xcHXHS+9 7Mg9Xuj4T2VP7ZB9z0syHwoqWfHkH4+0O1iSv3lvKNf0Y1mwGTriUv4Skm3Ry+AfFQza m3EIsB5i8Th2CIA5yR9DGeVy00PDE2ERGvfkWgVCbWn0OvBG6uFQHVU+WkGiJJis9EDV Sp54a0NAtKPIu5GyOMmEphgANi1535JCjvOIV9g9HAggjGbM7DkUhPOgS56HbmNvr9Uc pjMLJGT9hMPLFnDdUKDSLs7iIq9xqEvTFKqcvi2/0C1W1PcTggAIxNxkjthduqyTsAXq 5njw== X-Gm-Message-State: AO0yUKXe607+O6jxeuOIK57EqF2kxkvZLXYZ+AHeIpljXsSn5Rbvn5VU 4X56R438sInQEmD2Ul+J0MwdLjrFMjA= X-Google-Smtp-Source: AK7set/k9BmB/pRXsa2nV2M56g2rmuC1TAQkvYivIUQvBVhhGjsWf0pfQpZGSlyYvfU44zEzRt/kAg== X-Received: by 2002:a17:906:33ce:b0:92e:3b80:9841 with SMTP id w14-20020a17090633ce00b0092e3b809841mr3510368eja.42.1679165979246; Sat, 18 Mar 2023 11:59:39 -0700 (PDT) Received: from Provence.localdomain (dynamic-077-011-121-187.77.11.pool.telefonica.de. [77.11.121.187]) by smtp.gmail.com with ESMTPSA id ha18-20020a170906a89200b0092be4b381b7sm2423358ejb.81.2023.03.18.11.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 11:59:38 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Bernhard Beschow Subject: [PATCH for 8.0] qemu/osdep: Switch position of "extern" and "G_NORETURN" Date: Sat, 18 Mar 2023 19:59:31 +0100 Message-Id: <20230318185931.181659-1-shentey@gmail.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=shentey@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 Reviewed-by: Peter Maydell --- 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__)