[{"id":29408,"web_url":"https://patchwork.libcamera.org/comment/29408/","msgid":"<e72d7d9a-c6d2-47ba-a4d3-618b8184aae0@ideasonboard.com>","date":"2024-05-03T06:07:32","subject":"Re: [PATCH 4/4] meson: Deprecate bitwise operations between\n\tdifferent enumeration type","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 03/05/24 8:22 am, Laurent Pinchart wrote:\n> C++20 deprecates bitwise operations between different enumeration types.\n> This is a bad practice even in C++17, so enable the deprecation warning.\n> Doing so ensures no such operations will be added.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>   meson.build | 9 +++++++++\n>   1 file changed, 9 insertions(+)\n>\n> diff --git a/meson.build b/meson.build\n> index 39e4947f8c97..89320adbde1f 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -178,6 +178,15 @@ if cc.has_argument('-Wno-c99-designator')\n>       ]\n>   endif\n>   \n> +# Enable the C++20 deprecated enum-enum conversion warning if the compiler\n> +# supports it. This helps avoiding C++20 regressions, and should be removed\n> +# when switching to C++20 as the warning will then be enabled by default.\n> +if cxx.has_argument('-Wdeprecated-enum-enum-conversion')\n> +    cpp_arguments += [\n> +        '-Wdeprecated-enum-enum-conversion',\n> +    ]\n> +endif\n> +\n>   c_arguments += common_arguments\n>   cpp_arguments += common_arguments\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CC354C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 May 2024 06:07:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90B9863418;\n\tFri,  3 May 2024 08:07:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB36E63416\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 May 2024 08:07:33 +0200 (CEST)","from [192.168.1.105] (unknown [103.251.226.40])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 875442E7;\n\tFri,  3 May 2024 08:06:35 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"t72+tgN/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714716396;\n\tbh=f4XD/uTNUFX5/vK/KyoMcloiP9/Uq+TfLDSk4rLhQ00=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=t72+tgN/kyS8z++ikfys3rtMVw5aCylK05LQMLwcUpNweuVjQXPjafPIm2434oVt2\n\twC+FCJXsP8g+XE04SBYMjqk0bTdaz+qfZapb5i+Ko4Y7/nNlZWj9G9igtlwtSKwwf0\n\tIujdONzpNJ1TT4eHXYSACjljKRUQahPkZSgD3kCs=","Message-ID":"<e72d7d9a-c6d2-47ba-a4d3-618b8184aae0@ideasonboard.com>","Date":"Fri, 3 May 2024 11:37:32 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 4/4] meson: Deprecate bitwise operations between\n\tdifferent enumeration type","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20240503025205.2814-1-laurent.pinchart@ideasonboard.com>\n\t<20240503025205.2814-5-laurent.pinchart@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20240503025205.2814-5-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":29419,"web_url":"https://patchwork.libcamera.org/comment/29419/","msgid":"<20240503144458.f7s3lm76uwmefrcn@jasper>","date":"2024-05-03T14:44:58","subject":"Re: [PATCH 4/4] meson: Deprecate bitwise operations between\n\tdifferent enumeration type","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Laurent,\n\nthanks for the patch.\n\nOn Fri, May 03, 2024 at 05:52:05AM +0300, Laurent Pinchart wrote:\n> C++20 deprecates bitwise operations between different enumeration types.\n> This is a bad practice even in C++17, so enable the deprecation warning.\n> Doing so ensures no such operations will be added.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> \n\nCheers,\nStefan\n\n> ---\n>  meson.build | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/meson.build b/meson.build\n> index 39e4947f8c97..89320adbde1f 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -178,6 +178,15 @@ if cc.has_argument('-Wno-c99-designator')\n>      ]\n>  endif\n>  \n> +# Enable the C++20 deprecated enum-enum conversion warning if the compiler\n> +# supports it. This helps avoiding C++20 regressions, and should be removed\n> +# when switching to C++20 as the warning will then be enabled by default.\n> +if cxx.has_argument('-Wdeprecated-enum-enum-conversion')\n> +    cpp_arguments += [\n> +        '-Wdeprecated-enum-enum-conversion',\n> +    ]\n> +endif\n> +\n>  c_arguments += common_arguments\n>  cpp_arguments += common_arguments\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CDE71C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 May 2024 14:45:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75D5463418;\n\tFri,  3 May 2024 16:45:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F6ED61A8A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 May 2024 16:45:01 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:723:3164:ef7b:46ca])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ECA53E45;\n\tFri,  3 May 2024 16:44:02 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"m54MZfoo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714747443;\n\tbh=hRPiCrMOEalseUAepGx4Bw06L3NYozfDcE0tozV3ZuY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=m54MZfooQ7+WKvF4d5TtdaOV6FbKmzxG/iZMOF4eq2PYvgOBNNz51wtOn/rPMJclu\n\tI8KAOKtl5MmDl8sm98DgYcvnGtJmF2pQ/sdQ0uBnnRJa6OEbmMF96oHg6wumzg/Ldp\n\tHeoXbthKQlPa8+OpPCNhCmlGYFbo0gexX1Jik51g=","Date":"Fri, 3 May 2024 16:44:58 +0200","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 4/4] meson: Deprecate bitwise operations between\n\tdifferent enumeration type","Message-ID":"<20240503144458.f7s3lm76uwmefrcn@jasper>","References":"<20240503025205.2814-1-laurent.pinchart@ideasonboard.com>\n\t<20240503025205.2814-5-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240503025205.2814-5-laurent.pinchart@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]