From nobody Tue May 14 13:37:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1693362405; cv=none; d=zohomail.com; s=zohoarc; b=DqA2ZP18p8KKIr0xQhL8k1oNLM7gxPRUPf44h4r+rOpHJ65av41Q9Lq5aJYi9DXRDyiRuGf+k0/BBkZEoAJSwe4rg2y2zCFLQZfxgvSVxSJU6IkHMGN5e6hqcawdzlmSQXO9zUrhVjxffXYPt+BVHf6nUCVI3Gt+wCjNMbAr1+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693362405; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5fMqF4JPyjBxdbMqRIVZHqpDolrSgxQrfNo/OPx9hRc=; b=U96F7ICrrPYTh1uIn1h2TFex/TKrF35/UpYXvIR9MRpvvzuXoDAlTvyILmj5605DW4ItIMoMtpSPqtavyzpOZi0d/jOyeaOOfe0pplbWdRLtryMGI5L5eHCyW5NEefDrEwHmJ82IB1v2Ua7/WMLslXiziqVrfrUNkXbDZh3+kyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1693362404963399.33657784197067; Tue, 29 Aug 2023 19:26:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbAtf-00013L-9q; Tue, 29 Aug 2023 22:25:31 -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 1qbAtd-00012o-PB for qemu-devel@nongnu.org; Tue, 29 Aug 2023 22:25:29 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbAtZ-00025I-Vb for qemu-devel@nongnu.org; Tue, 29 Aug 2023 22:25:29 -0400 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-77ac14ff51bso163660539f.3 for ; Tue, 29 Aug 2023 19:25:25 -0700 (PDT) Received: from dune.bsdimp.com (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id h16-20020a0566380f1000b0042b61a5087csm3369250jas.132.2023.08.29.19.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 19:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1693362324; x=1693967124; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5fMqF4JPyjBxdbMqRIVZHqpDolrSgxQrfNo/OPx9hRc=; b=M2A5EZxPB2Be+mE9BNT+R8MuyyrlFmqrOvXeIfj1QbzgJS40B6OL+bB6x6W3RFF7h8 AFcpw5EjEDN1xjWLlqM8mPQ7ftrftn868iN+TtFE5V8CHogqRHJM25MyZMP7hJFzHvcp CvkKlZto4dfQxEKLqurgr0O56kg/ZKI7EfYVk/DS3HzXGHFV79q4KMsm1uyCQSY+JNmX ULcF9UV6UUiRVQx89H2RHiLyEtE0tIrQmsRDZRZgifHYHr4Ro8g0rdNJCJsU3fPUVdxG NCBzYXt+m6h8YHEpqbpySlXLAUG/INoCyPr3q+WQe3uebM4O1KMxdO+EQg2KzWnJ+EGE 1jqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693362324; x=1693967124; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5fMqF4JPyjBxdbMqRIVZHqpDolrSgxQrfNo/OPx9hRc=; b=gymu5n8OHh4Z1VRKIgcLyoj0ZMXRIMbpGuSXGi0FvUtSvEgYN9geWPStEgeXdqMsNQ 20G8ie1DkWjUIRmzonqqRm9Rsg/qMQEcbyjJDYtcTCyXYH1lXBvq2UR7rxZCMaPlzc6y oj1Kg1BJxovQfhoFWQO3Q1vNbLhgTlnpEwfV0oJHh2se5C22B8SX+PEC5fP8LTWEXUTv T3AboyHk980x+OLDv2IoKiVhJaYLMFvokE4a0IV8DU6Ssnqs53pB9n34jIrsgTtAiBsQ s0UNC2gOp+7m5GixJCsyXrLZiYaLVyB2GAkpF8LvFrrGaG0RlfHxCIUnYQaqr2JaNdgb kliQ== X-Gm-Message-State: AOJu0YzAMiWiNIa+Jvm/sbvXSN5IrWo62JJLYHA+hUlO1E8vUhG3vlP+ wnZckWylhv/vQz1tQLV40QKsDOeU1mbU4qGRNGY= X-Google-Smtp-Source: AGHT+IEAjHdy+oIE+wlhmdBUFE8wai4FjH/eJV2s7pysjYtS6kpa0TGVQT377blwThBFl4aduUGn9Q== X-Received: by 2002:a5d:990f:0:b0:792:792e:6616 with SMTP id x15-20020a5d990f000000b00792792e6616mr1227737iol.2.1693362324281; Tue, 29 Aug 2023 19:25:24 -0700 (PDT) From: Warner Losh To: qemu-devel@nongnu.org Cc: Laurent Vivier , Thomas Huth , Beraldo Leal , Wainer dos Santos Moschetta , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Warner Losh , Richard Henderson Subject: [PULL 1/1] linux-user: Move PRAGMA_DISABLE_PACKED_WARNING to compiler.h Date: Tue, 29 Aug 2023 20:22:05 -0600 Message-ID: <20230830022205.57878-2-imp@bsdimp.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230830022205.57878-1-imp@bsdimp.com> References: <20230830022205.57878-1-imp@bsdimp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::d2d; envelope-from=imp@bsdimp.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @bsdimp-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1693362406070100003 Content-Type: text/plain; charset="utf-8" Replace the slightly older version of this in include/qemu/compiler.h that was commit as part of bsd-user changes with the newer one from linux-user. bsd-user has no regreassions with this. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- include/qemu/compiler.h | 6 +----- linux-user/qemu.h | 26 -------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index b0374425180..0df9febbe2f 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -31,17 +31,13 @@ * functions than host-endian unaligned load/store plus tswapN. * - The pragmas are necessary only to silence a clang false-positive * warning: see https://bugs.llvm.org/show_bug.cgi?id=3D39113 . - * - We have to disable -Wpragmas warnings to avoid a complaint about - * an unknown warning type from older compilers that don't know about - * -Waddress-of-packed-member. * - gcc has bugs in its _Pragma() support in some versions, eg * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83256 -- so we only * include the warning-suppression pragmas for clang */ -#ifdef __clang__ +#if defined(__clang__) && __has_warning("-Waddress-of-packed-member") #define PRAGMA_DISABLE_PACKED_WARNING \ _Pragma("GCC diagnostic push"); \ - _Pragma("GCC diagnostic ignored \"-Wpragmas\""); \ _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"") =20 #define PRAGMA_REENABLE_PACKED_WARNING \ diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 4f8b55e2fb0..12821e54d0a 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -193,32 +193,6 @@ static inline bool access_ok(CPUState *cpu, int type, These are usually used to access struct data members once the struct has been locked - usually with lock_user_struct. */ =20 -/* - * Tricky points: - * - Use __builtin_choose_expr to avoid type promotion from ?:, - * - Invalid sizes result in a compile time error stemming from - * the fact that abort has no parameters. - * - It's easier to use the endian-specific unaligned load/store - * functions than host-endian unaligned load/store plus tswapN. - * - The pragmas are necessary only to silence a clang false-positive - * warning: see https://bugs.llvm.org/show_bug.cgi?id=3D39113 . - * - gcc has bugs in its _Pragma() support in some versions, eg - * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83256 -- so we only - * include the warning-suppression pragmas for clang - */ -#if defined(__clang__) && __has_warning("-Waddress-of-packed-member") -#define PRAGMA_DISABLE_PACKED_WARNING \ - _Pragma("GCC diagnostic push"); \ - _Pragma("GCC diagnostic ignored \"-Waddress-of-packed-member\"") - -#define PRAGMA_REENABLE_PACKED_WARNING \ - _Pragma("GCC diagnostic pop") - -#else -#define PRAGMA_DISABLE_PACKED_WARNING -#define PRAGMA_REENABLE_PACKED_WARNING -#endif - #define __put_user_e(x, hptr, e) = \ do { = \ PRAGMA_DISABLE_PACKED_WARNING; = \ --=20 2.41.0