From patchwork Fri May 3 02:52:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19995 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C7A03C3220 for ; Fri, 3 May 2024 02:52:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B84A6341F; Fri, 3 May 2024 04:52:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Icy2OHTi"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 15C726341B for ; Fri, 3 May 2024 04:52:18 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 07EC1675 for ; Fri, 3 May 2024 04:51:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714704680; bh=zR3Qe61inIbjdZrwugcRVD2FeALZgtjBGiF+qCJ2eA8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Icy2OHTilWwfDIhyljVVLRSeC6J6qYZHZyxZpP69di9lY5AT0XoDSpF8o5SKU27cW vz5ENc/DjWoPymob7i07xuyV2FadZq9p+ej+ud2Gb4iV1jZ/o0wdqGtiCxniq/Vnxu Cw3aLwE+37nz/+s1nNNYH8AObiKh5nC3A9mmo5BY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 4/4] meson: Deprecate bitwise operations between different enumeration type Date: Fri, 3 May 2024 05:52:05 +0300 Message-ID: <20240503025205.2814-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240503025205.2814-1-laurent.pinchart@ideasonboard.com> References: <20240503025205.2814-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" C++20 deprecates bitwise operations between different enumeration types. This is a bad practice even in C++17, so enable the deprecation warning. Doing so ensures no such operations will be added. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Stefan Klug --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meson.build b/meson.build index 39e4947f8c97..89320adbde1f 100644 --- a/meson.build +++ b/meson.build @@ -178,6 +178,15 @@ if cc.has_argument('-Wno-c99-designator') ] endif +# Enable the C++20 deprecated enum-enum conversion warning if the compiler +# supports it. This helps avoiding C++20 regressions, and should be removed +# when switching to C++20 as the warning will then be enabled by default. +if cxx.has_argument('-Wdeprecated-enum-enum-conversion') + cpp_arguments += [ + '-Wdeprecated-enum-enum-conversion', + ] +endif + c_arguments += common_arguments cpp_arguments += common_arguments