[{"id":24895,"web_url":"https://patchwork.libcamera.org/comment/24895/","msgid":"<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>","date":"2022-09-02T14:18:03","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Marco,\n\nThank you for the patch.\n\nOn Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> Take color space into account for YUV rendering\"). Fix it by making the\n> full range as default.\n\nWhat exact compiler version are you using ? gcc 11.3.0 compiles the code\nfine here. It seems to be a false positive, but if it causes breakages,\nwe of course want to fix/work around the problem.\n\n> Fixes: 251f0534 (\"qcam: viewfinder_gl: Take color space into account for YUV rendering\")\n> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>\n> ---\n>  src/qcam/viewfinder_gl.cpp | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> index e2aa2470..501c5bae 100644\n> --- a/src/qcam/viewfinder_gl.cpp\n> +++ b/src/qcam/viewfinder_gl.cpp\n> @@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)\n>  \tdouble offset;\n>  \n>  \tswitch (colorSpace.range) {\n> +\tdefault: /* Avoid gcc11 maybe-uninitialized warning */\n>  \tcase libcamera::ColorSpace::Range::Full:\n>  \t\toffset = 0.0;\n>  \t\tbreak;","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 55EB8C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 14:18:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A3A0C61FF1;\n\tFri,  2 Sep 2022 16:18:18 +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 DBB0061F9D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Sep 2022 16:18:16 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 380F8749;\n\tFri,  2 Sep 2022 16:18:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662128298;\n\tbh=i4IkUJNiBlNWZzMKu5tMC28XFuQ+EOzuB//tBZXlGU0=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Nk2l78R81eIYDgUGunD5Qtm9Wo4zJ2OZjwwe1EV8UV6KYZBAdHJ3GAOpe32hFlCvx\n\tyKdJFo7kFNb0uIfG0E8XIRmnGykUQ3wCIh8a6Im4aEpQkNrhhXvScSMNRrfcC/FqIe\n\tAYJNkV/9lwgne9BQBREdKwhzDnzTmU5gLev44OLYBZUzWqSGZMKKRPSpe7ACRfljom\n\tH/dcc1u0dMFhOQNU64+JW0SjhvLpZBGU4hDqIrIEGAeZ6w1eVNUs2PPJpdyM73IJ4z\n\th7aY1RtSaOjAAtBXDJHf/kRBw96KAaxEVZYtBPWp17R5kOE4MEzBH83irmThbHQXVl\n\tuUh7uHK0bBuPA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662128296;\n\tbh=i4IkUJNiBlNWZzMKu5tMC28XFuQ+EOzuB//tBZXlGU0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jnY+wFIaWmn1izNzW64fcIp6o+LgF3/n1vC2Hk3ZILQDNNUowV/d6mpNDRk4w8mEQ\n\t/icEU8VlEe1Bp7+CtcHt3w3rRlNPETpQGV618/4B8LF4U1fXfaRaTWh+oYDXM8cX18\n\tFWa3HUziAh1d60EzLcREcCgCkYff1rd1TUloE1Vk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jnY+wFIa\"; dkim-atps=neutral","Date":"Fri, 2 Sep 2022 17:18:03 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>","Message-ID":"<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220902141136.1342352-1-m.felsch@pengutronix.de>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"mfe@pengutronix.de, libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24896,"web_url":"https://patchwork.libcamera.org/comment/24896/","msgid":"<20220902144255.sarht6nuxjsvfqkl@pengutronix.de>","date":"2022-09-02T14:42:55","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":89,"url":"https://patchwork.libcamera.org/api/people/89/","name":"Marco Felsch","email":"m.felsch@pengutronix.de"},"content":"Hi Laurent,\n\nOn 22-09-02, Laurent Pinchart wrote:\n> Hi Marco,\n> \n> Thank you for the patch.\n> \n> On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > Take color space into account for YUV rendering\"). Fix it by making the\n> > full range as default.\n> \n> What exact compiler version are you using ? gcc 11.3.0 compiles the code\n> fine here. It seems to be a false positive, but if it causes breakages,\n> we of course want to fix/work around the problem.\n\nArg.. I'm using 11.1.1 from the official OSELAS.Toolchain-2021.07.0\ncross-toolchain. So it seems my gcc-11 is to old.\n\nRegards,\n  Marco","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 7FF86C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 14:42:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA54761FF2;\n\tFri,  2 Sep 2022 16:42:57 +0200 (CEST)","from metis.ext.pengutronix.de (metis.ext.pengutronix.de\n\t[IPv6:2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 78A0361F9D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Sep 2022 16:42:56 +0200 (CEST)","from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0])\n\tby metis.ext.pengutronix.de with esmtps\n\t(TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)\n\t(envelope-from <mfe@pengutronix.de>)\n\tid 1oU7sm-000297-2P; Fri, 02 Sep 2022 16:42:56 +0200","from mfe by ptx.hi.pengutronix.de with local (Exim 4.92)\n\t(envelope-from <mfe@pengutronix.de>)\n\tid 1oU7sl-0003T6-Pw; Fri, 02 Sep 2022 16:42:55 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662129777;\n\tbh=MCCJ8ozSIuU2+dJFWwNzenD3Bg+d/QIAAo2aFrE6tK8=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=W0tAHEnyHIGQrqsuuy3KKW7P5y6mpn/k3COxF9Qlk4wNYjiF/6miM0R3Q6XI7Rehv\n\t8dpfYie9sKBTufxNRx2i4EiunRM3GeaE057SSGcFpZWm2eIROLptgML34858xFqSYO\n\tbfyupdwMI6VQLBHND1o9TR5hYINydBwU/52nBSv35+DfNo+npfTv7JdzISaljaK2i5\n\tiBSxTKhxDKRynj4y9qQ7ZK4Bq2Moh4ZW9U0g/pfcRWh9hLCGdiVrJu+qlWmw7z+f8A\n\tpBEW58IK1fmMZazS2JlcRQdNrjdqkx8gs9EaXY5VdQEyRkW/9AuqEJbnXBC0pYppVe\n\t38M2O32P+omYQ==","Date":"Fri, 2 Sep 2022 16:42:55 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220902144255.sarht6nuxjsvfqkl@pengutronix.de>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","X-SA-Exim-Connect-IP":"2001:67c:670:100:1d::c0","X-SA-Exim-Mail-From":"mfe@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false","X-PTX-Original-Recipient":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Marco Felsch via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Marco Felsch <m.felsch@pengutronix.de>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24897,"web_url":"https://patchwork.libcamera.org/comment/24897/","msgid":"<YxJ6Ow/HEwQJ+hn4@pendragon.ideasonboard.com>","date":"2022-09-02T21:48:43","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Marco,\n\nOn Fri, Sep 02, 2022 at 04:42:55PM +0200, Marco Felsch wrote:\n> On 22-09-02, Laurent Pinchart wrote:\n> > On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > > Take color space into account for YUV rendering\"). Fix it by making the\n> > > full range as default.\n> > \n> > What exact compiler version are you using ? gcc 11.3.0 compiles the code\n> > fine here. It seems to be a false positive, but if it causes breakages,\n> > we of course want to fix/work around the problem.\n> \n> Arg.. I'm using 11.1.1 from the official OSELAS.Toolchain-2021.07.0\n> cross-toolchain. So it seems my gcc-11 is to old.\n\nI think this is a false positive caused by a bug in gcc, which seems to\nhave been fixed in later releases. gcc 10.4.0, 11.3.0 and 12.2.0 all\ncompile libcamera without warning, in both debug and release modes. I\nhave however been able to reproduce the issue with gcc 12.1.0 (along\nwith a second warning that complains about the yuv2rgb matrix being used\nuninitialized).\n\nThis being said, as the problem affects real use cases, we'll fix it.","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 90FA4C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 21:48:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E2CF961FFC;\n\tFri,  2 Sep 2022 23:48:57 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DE2961FF4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Sep 2022 23:48:56 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 28633749;\n\tFri,  2 Sep 2022 23:48:56 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662155337;\n\tbh=Go0LK/EG48J3EVosGzUcK0nC5QP5bA6DO/Au1jJyoRc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=C+L7tBQibVJC5IKFPcfTsGzuGo2EH3NSJ3oCbALOoBqCv2kX6bzL/DOPv+i4+Ea9y\n\tzV7hXa1IV4snFS3Ahnjwd/CcpRvFqaqU/sHLDIYmWqqbnq94QoxCv4/t5CLj3njE3q\n\tJtk+ZN5/gwTl4N81En/rVanN9icmuDt19ZjIj70M/mqVsfUYbL3ySOJlUtWpPwxxVT\n\tVQTGWUfw1cpYjP1pNpxlvUNDxdlu5ESxFpTjMGQ3nZVzalC6Zc9Yo+4mNkpKmIZn96\n\tefeS9krUWp17x6eTjAItdA68Am981SMUMDFmkK7fiA53bf59JQ0K13u0EMF5/z9i/b\n\tzFDG1osqX2txg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662155336;\n\tbh=Go0LK/EG48J3EVosGzUcK0nC5QP5bA6DO/Au1jJyoRc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=blDKKA8MOev1zSifvvGig//Rr+1t5ZlZV3cRn9y4pheJ+6bIdLNqOlbz2vR4P/rvj\n\t+Alkx2Z+c8P00+yz4+jCKFbDTKBYH6cF3kW+Bc+C8jezzzSDaEC6G/CmYNqPwn+X+Z\n\t0yasK4GDbzUKZKt4MdxZ9wExds2iVx32JIf71QKw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"blDKKA8M\"; dkim-atps=neutral","Date":"Sat, 3 Sep 2022 00:48:43 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>","Message-ID":"<YxJ6Ow/HEwQJ+hn4@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>\n\t<20220902144255.sarht6nuxjsvfqkl@pengutronix.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220902144255.sarht6nuxjsvfqkl@pengutronix.de>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24900,"web_url":"https://patchwork.libcamera.org/comment/24900/","msgid":"<YxKNogfjskjzyFQ9@pendragon.ideasonboard.com>","date":"2022-09-02T23:11:30","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Sat, Sep 03, 2022 at 12:48:43AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> On Fri, Sep 02, 2022 at 04:42:55PM +0200, Marco Felsch wrote:\n> > On 22-09-02, Laurent Pinchart wrote:\n> > > On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > > > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > > > Take color space into account for YUV rendering\"). Fix it by making the\n> > > > full range as default.\n> > > \n> > > What exact compiler version are you using ? gcc 11.3.0 compiles the code\n> > > fine here. It seems to be a false positive, but if it causes breakages,\n> > > we of course want to fix/work around the problem.\n> > \n> > Arg.. I'm using 11.1.1 from the official OSELAS.Toolchain-2021.07.0\n> > cross-toolchain. So it seems my gcc-11 is to old.\n> \n> I think this is a false positive caused by a bug in gcc, which seems to\n> have been fixed in later releases. gcc 10.4.0, 11.3.0 and 12.2.0 all\n> compile libcamera without warning, in both debug and release modes. I\n> have however been able to reproduce the issue with gcc 12.1.0 (along\n> with a second warning that complains about the yuv2rgb matrix being used\n> uninitialized).\n\nAnother data point: gcc 10.4.0 compiles fine with both -O0 and -O3. gcc\n11.3.0 abd 12.2.0 compiles fine with -O0 but produces the warning with\n-O3, which I missed when testing the offending commit.\n\nhttps://gcc.gnu.org/wiki/VerboseDiagnostics#enum_switch is related. I've\nread mode on the topic, and C++17 has introduced an \"interesting\"\nfeature:\n\nAn enumeration can be initialized from an integer without a cast, using\nlist initialization, if all of the following are true:\n\n    the initialization is direct-list-initialization\n    the initializer list has only a single element\n    the enumeration is either scoped or unscoped with underlying type fixed\n    the conversion is non-narrowing\n\nThis makes it possible to introduce new integer types (e.g. SafeInt)\nthat enjoy the same existing calling conventions as their underlying\ninteger types, even on ABIs that penalize passing/returning structures\nby value.\n\n[...]\n\nenum class Handle : std::uint32_t { Invalid = 0 };\nHandle h{42}; // OK as of C++17\n\n(source: https://en.cppreference.com/w/cpp/language/enum)\n\ngcc thus seems to be right to consider that colorSpace.range could have\nother values than Full or Limited, even if it's a scoped enumeration.\nI'm not sure I like what C++17 is doing there, but I can't blame the\ncompiler :-S\n\n> This being said, as the problem affects real use cases, we'll fix it.","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 8829BC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 23:11:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D476062002;\n\tSat,  3 Sep 2022 01:11:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC7A861FF8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Sep 2022 01:11:43 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1510A6DD;\n\tSat,  3 Sep 2022 01:11:43 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662160304;\n\tbh=u2cF7mHvbYAxMevk+hjX7exCYh8qjNnZbM3N/WJez84=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=BFR+ZzFt90NVD+9IfjdiCLYCWvyBy6OIXh0b0BbbsiXOZksTIqYEhB+xtFm9ehXEL\n\trY+Fkmrs/vjFv1kKWTSI0HFdD4mfGplxx8jkp+zuLzcGZZwAOJi9dh90XInu+wB8RI\n\tFx51fnpJXPwCwzcdBDe5oCbU323BFhmpDEVC0QwUiWz3btquXr02Dh7bUip6sDqC1V\n\tl/mgtBO45hnG1EUFkHVB3YPq69k5WBXlySjJD7nXvbOK40TR/UP18zef7Fh5FkPWun\n\tH0Cc441VF/qLJ2c1rvRoUbval1ks+Ycv64ptn1pHXa3sSEbfS1Zb5yxihOhRioi4py\n\t/H5ciMrcmCbsg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662160303;\n\tbh=u2cF7mHvbYAxMevk+hjX7exCYh8qjNnZbM3N/WJez84=;\n\th=Date:From:To:Subject:References:In-Reply-To:From;\n\tb=DXx7P5X1prEuUk8nrJBe0wFjgfelySUEpEM2RkiQvz/43rxEC5h/62acXAvCwrNqa\n\tmtv+U6rBv4FwRtjiCgNuqB5g4SbKcW/K74ZtSWSs8IiaBoz1Y5pX62J/uBJrRl93QU\n\tq6UPRP8Y0YbtOC5aQk74RkF7eQVrsMfYew9t4mDM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DXx7P5X1\"; dkim-atps=neutral","Date":"Sat, 3 Sep 2022 02:11:30 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<YxKNogfjskjzyFQ9@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxIQm6wA+/kZvfeT@pendragon.ideasonboard.com>\n\t<20220902144255.sarht6nuxjsvfqkl@pengutronix.de>\n\t<YxJ6Ow/HEwQJ+hn4@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YxJ6Ow/HEwQJ+hn4@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24901,"web_url":"https://patchwork.libcamera.org/comment/24901/","msgid":"<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>","date":"2022-09-02T23:31:37","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Marco,\n\nGoing back to the patch now.\n\nOn Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> Take color space into account for YUV rendering\"). Fix it by making the\n> full range as default.\n\nI'd like to mention the result of the investigation I detailed in a\nseparate reply in this mail thread. Would you be fine with the following\ncommit message ?\n\nCommit 251f0534 (\"qcam: viewfinder_gl: Take color space into account for\nYUV rendering\") introduced a maybe-uninitialized warning with gcc 11 and\n12. The compiler is correct, as C++17 allows initializing a scoped enum\nfrom an integer using direct-list-initialization, even if the integer\nvalue doesn't match any of the enumerators for the scoped enum ([1]).\n\nFix the warning by making the full range the default.\n\nhttps://en.cppreference.com/w/cpp/language/enum#enum_relaxed_init_cpp17\n\n> Fixes: 251f0534 (\"qcam: viewfinder_gl: Take color space into account for YUV rendering\")\n> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>\n> ---\n>  src/qcam/viewfinder_gl.cpp | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> index e2aa2470..501c5bae 100644\n> --- a/src/qcam/viewfinder_gl.cpp\n> +++ b/src/qcam/viewfinder_gl.cpp\n> @@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)\n>  \tdouble offset;\n>  \n>  \tswitch (colorSpace.range) {\n> +\tdefault: /* Avoid gcc11 maybe-uninitialized warning */\n\nGiven that this is a valid behaviour for the compiler, and not a false\npositive as I initially thought, I think we can drop the comment. If you\ndon't mind I'll also move the default one line down, just right after\nthe Full case.\n\nThere's no need to submit a v2 if you're fine with these changes, I'll\napply them locally.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \tcase libcamera::ColorSpace::Range::Full:\n>  \t\toffset = 0.0;\n>  \t\tbreak;","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 97ECEC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 23:31:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C6F762011;\n\tSat,  3 Sep 2022 01:31:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CFE4C61FF2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Sep 2022 01:31:50 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2BF6F6DD;\n\tSat,  3 Sep 2022 01:31:50 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662161513;\n\tbh=SuZOxlWKmV1NTL9YLW0dL9btlwiLBmP/9T5dxmo5VEk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=gvza3wOR8Myf94uXPhb9MzaHHTxyuAa7bt1geg9p5HDabUG74bxSisSJwLf7ssbQH\n\tGvYVhAxxWkvDoe60qPswDP3VWQ4+RSXsDY7NhfVkxgzmSgRF/MREoZ9/F3tkpf53FA\n\tNcxfDPN2ZkaDC5B6KjfMOUqJN8Uj8fv8/6HuFZWb2Qwlj8WsT0jgE9d0UOTmgHCgx2\n\tBFJizCmDlH+EWpg2B1u4IJAELShMZnvEUt+lXBunpcytMmJ7T/IKiVF4L7ISvVX+LL\n\tsEZkLVveNDQnHmJPYSyUTKO7yqVUjm59gFwhSIm5Py1RDaZ2el9ZxSNDJiWFOcrqM6\n\t7oTTWqR+GG4iQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662161510;\n\tbh=SuZOxlWKmV1NTL9YLW0dL9btlwiLBmP/9T5dxmo5VEk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZWjLt9JTc+Pm/bajKnYbtMkFE9Cvnh6U0+cwnTnByggBcRhrjqXVrEl417ANYjEne\n\tMs0ofm1ykWgU+zdNGR5jTEH2xLOyhdEL1HNpIw0UdGBap3DMfBpT3vovGOP/WfQEfl\n\tFAYJNn8MhRdGZmZbuSc1B2r/whJxM206vWR5zfXI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZWjLt9JT\"; dkim-atps=neutral","Date":"Sat, 3 Sep 2022 02:31:37 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>","Message-ID":"<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220902141136.1342352-1-m.felsch@pengutronix.de>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"mfe@pengutronix.de, libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24902,"web_url":"https://patchwork.libcamera.org/comment/24902/","msgid":"<YxKSmMmiFdHPu2Y9@pendragon.ideasonboard.com>","date":"2022-09-02T23:32:40","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Sat, Sep 03, 2022 at 02:31:39AM +0300, Laurent Pinchart wrote:\n> Hi Marco,\n> \n> Going back to the patch now.\n> \n> On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > Take color space into account for YUV rendering\"). Fix it by making the\n> > full range as default.\n> \n> I'd like to mention the result of the investigation I detailed in a\n> separate reply in this mail thread. Would you be fine with the following\n> commit message ?\n> \n> Commit 251f0534 (\"qcam: viewfinder_gl: Take color space into account for\n> YUV rendering\") introduced a maybe-uninitialized warning with gcc 11 and\n> 12. The compiler is correct, as C++17 allows initializing a scoped enum\n> from an integer using direct-list-initialization, even if the integer\n> value doesn't match any of the enumerators for the scoped enum ([1]).\n> \n> Fix the warning by making the full range the default.\n> \n> https://en.cppreference.com/w/cpp/language/enum#enum_relaxed_init_cpp17\n> \n> > Fixes: 251f0534 (\"qcam: viewfinder_gl: Take color space into account for YUV rendering\")\n\nI also forgot to mention, Fixes tags should use 12 digits for the commit\nID. I can also address this locally.\n\n> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>\n> > ---\n> >  src/qcam/viewfinder_gl.cpp | 1 +\n> >  1 file changed, 1 insertion(+)\n> > \n> > diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> > index e2aa2470..501c5bae 100644\n> > --- a/src/qcam/viewfinder_gl.cpp\n> > +++ b/src/qcam/viewfinder_gl.cpp\n> > @@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)\n> >  \tdouble offset;\n> >  \n> >  \tswitch (colorSpace.range) {\n> > +\tdefault: /* Avoid gcc11 maybe-uninitialized warning */\n> \n> Given that this is a valid behaviour for the compiler, and not a false\n> positive as I initially thought, I think we can drop the comment. If you\n> don't mind I'll also move the default one line down, just right after\n> the Full case.\n> \n> There's no need to submit a v2 if you're fine with these changes, I'll\n> apply them locally.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> >  \tcase libcamera::ColorSpace::Range::Full:\n> >  \t\toffset = 0.0;\n> >  \t\tbreak;","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 C253BC0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 23:32:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8335662014;\n\tSat,  3 Sep 2022 01:32:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7486161FF2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Sep 2022 01:32:53 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EC9C06DD;\n\tSat,  3 Sep 2022 01:32:52 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662161574;\n\tbh=XMorkkAcXTkuvDQCav5hJFrYNFrCxkdBXoH0cQKbzzo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=FepO4rRPTeSsYatd4INNXqtDsiMsKjCYZC66PluI04t9Dxyza/iqhpPWm+ohjAyaX\n\tF1Uoq4Bx4X4MuegSAqwLXoNCwlmkHrFXU+56zXb/aWti/JvC6VuVYjTr5D6IoZ8k+R\n\th8PL9FT8nlwuWNTRGkBlaOIFKqOdhQLHr21Y42mtTDzjkGXI7awEN9hCY1zzkpZ+Ly\n\tO0C9cQO2Sw76zmF2OHszWkvCK04OJ++c1LyG1iXpQqvnou2HE5IS2dpeRTkRIXMh9g\n\tKoCLP01z1ZhAe9KHR/6gczeK8L8ELsZmavLxlwmp8H77jz8ek74x+barXNWlkZBm1S\n\t7etd2u/ibDLEQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662161573;\n\tbh=XMorkkAcXTkuvDQCav5hJFrYNFrCxkdBXoH0cQKbzzo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AJ+e23DBy0eR0XKMXK21GvwcQpPgbUYyVVB+X74RYMJRDpBSpug3hfbekSdkxXla6\n\tYdsULiP32HApJZ6Pnk8qH6UZPVtjExA4YNLTnI2HqmxC/1EuMK4Ze0l451l4NwweDv\n\ttYqF3wom4kwSd7rhGEkH+NgTmxEx6qQzMJ4myv74="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AJ+e23DB\"; dkim-atps=neutral","Date":"Sat, 3 Sep 2022 02:32:40 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>","Message-ID":"<YxKSmMmiFdHPu2Y9@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"mfe@pengutronix.de, libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24903,"web_url":"https://patchwork.libcamera.org/comment/24903/","msgid":"<YxKZXkdPevLk3QMK@pendragon.ideasonboard.com>","date":"2022-09-03T00:01:34","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Sat, Sep 03, 2022 at 02:32:40AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> On Sat, Sep 03, 2022 at 02:31:39AM +0300, Laurent Pinchart wrote:\n> > Hi Marco,\n> > \n> > Going back to the patch now.\n> > \n> > On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > > Take color space into account for YUV rendering\"). Fix it by making the\n> > > full range as default.\n> > \n> > I'd like to mention the result of the investigation I detailed in a\n> > separate reply in this mail thread. Would you be fine with the following\n> > commit message ?\n> > \n> > Commit 251f0534 (\"qcam: viewfinder_gl: Take color space into account for\n> > YUV rendering\") introduced a maybe-uninitialized warning with gcc 11 and\n> > 12. The compiler is correct, as C++17 allows initializing a scoped enum\n> > from an integer using direct-list-initialization, even if the integer\n> > value doesn't match any of the enumerators for the scoped enum ([1]).\n> > \n> > Fix the warning by making the full range the default.\n> > \n> > https://en.cppreference.com/w/cpp/language/enum#enum_relaxed_init_cpp17\n> > \n> > > Fixes: 251f0534 (\"qcam: viewfinder_gl: Take color space into account for YUV rendering\")\n> \n> I also forgot to mention, Fixes tags should use 12 digits for the commit\n> ID. I can also address this locally.\n\nAlso, gcc 12.2.0 still warns about the second switch statement in the\nsame function. I'll submit a v2 of your patch to fix that as well.\n\n> > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>\n> > > ---\n> > >  src/qcam/viewfinder_gl.cpp | 1 +\n> > >  1 file changed, 1 insertion(+)\n> > > \n> > > diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> > > index e2aa2470..501c5bae 100644\n> > > --- a/src/qcam/viewfinder_gl.cpp\n> > > +++ b/src/qcam/viewfinder_gl.cpp\n> > > @@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)\n> > >  \tdouble offset;\n> > >  \n> > >  \tswitch (colorSpace.range) {\n> > > +\tdefault: /* Avoid gcc11 maybe-uninitialized warning */\n> > \n> > Given that this is a valid behaviour for the compiler, and not a false\n> > positive as I initially thought, I think we can drop the comment. If you\n> > don't mind I'll also move the default one line down, just right after\n> > the Full case.\n> > \n> > There's no need to submit a v2 if you're fine with these changes, I'll\n> > apply them locally.\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > \n> > >  \tcase libcamera::ColorSpace::Range::Full:\n> > >  \t\toffset = 0.0;\n> > >  \t\tbreak;","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 06D87C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Sep 2022 00:01:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1A8ED62018;\n\tSat,  3 Sep 2022 02:01:49 +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 A4DAB61FF2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Sep 2022 02:01:47 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 005676DD;\n\tSat,  3 Sep 2022 02:01:46 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662163309;\n\tbh=VB/Sl0UX5+tzY9sc/Id3JK/MFpW9q/8U2UxOD3TZEes=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=hgUT7wabLfyn/r399wd7D8ysQp6+PdTDXHDM19fvn1i01Ut/Dd4gICGwJnExnlNMW\n\tzkn2tF/FTBhZsOyZD30O3p/0B0he7e1UlQnJ9lW3rNVz1FFQt4QK6cLmwLkNJDLrXF\n\tpTKZsMLUjNL1PShJnNwoekJKyF3oPylrKcySeYJZ/19eADNjZR32fxwhAUxIgrhqxW\n\tBJwf+PI7TY1C8GbbyOom38mcdZpwarNpwhtHgbI7JURUhoiV30CKpM//ML2ruFIoeg\n\tg99KDELku41unReKxCans19FX8ujPPMMCyxuvqGqVVirwNdC8EEzB5LpV5HUgR0rnf\n\t9Rc6LvtEoGaDw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662163307;\n\tbh=VB/Sl0UX5+tzY9sc/Id3JK/MFpW9q/8U2UxOD3TZEes=;\n\th=Date:From:To:Subject:References:In-Reply-To:From;\n\tb=rP8I1lWdzj3yLBn+WOvo5PnVgjkfVikmF9I+JtjMtw5DmLYPc8m5SjITWWVLj4XHK\n\t3TbRHx48FAUH5AWIBWGNX02p/nMg9s26c4QEfEnATw9337VyffMVtsl2ZWPG8lcr3P\n\tbfX7Ju/+xakO7YLzrMHZRgy+FpKN7j0/tIe3YWTY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rP8I1lWd\"; dkim-atps=neutral","Date":"Sat, 3 Sep 2022 03:01:34 +0300","To":"Marco Felsch <m.felsch@pengutronix.de>, mfe@pengutronix.de,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<YxKZXkdPevLk3QMK@pendragon.ideasonboard.com>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>\n\t<YxKSmMmiFdHPu2Y9@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YxKSmMmiFdHPu2Y9@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24933,"web_url":"https://patchwork.libcamera.org/comment/24933/","msgid":"<20220905093031.fg4536cqpg4ax7o6@pengutronix.de>","date":"2022-09-05T09:30:31","subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","submitter":{"id":89,"url":"https://patchwork.libcamera.org/api/people/89/","name":"Marco Felsch","email":"m.felsch@pengutronix.de"},"content":"Hi Laurent,\n\nOn 22-09-03, Laurent Pinchart wrote:\n> On Sat, Sep 03, 2022 at 02:32:40AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > On Sat, Sep 03, 2022 at 02:31:39AM +0300, Laurent Pinchart wrote:\n> > > Hi Marco,\n> > > \n> > > Going back to the patch now.\n> > > \n> > > On Fri, Sep 02, 2022 at 04:11:36PM +0200, Marco Felsch via libcamera-devel wrote:\n> > > > Fix gcc11 warning introduced in commit 251f0534 (\"qcam: viewfinder_gl:\n> > > > Take color space into account for YUV rendering\"). Fix it by making the\n> > > > full range as default.\n> > > \n> > > I'd like to mention the result of the investigation I detailed in a\n> > > separate reply in this mail thread. Would you be fine with the following\n> > > commit message ?\n> > > \n> > > Commit 251f0534 (\"qcam: viewfinder_gl: Take color space into account for\n> > > YUV rendering\") introduced a maybe-uninitialized warning with gcc 11 and\n> > > 12. The compiler is correct, as C++17 allows initializing a scoped enum\n> > > from an integer using direct-list-initialization, even if the integer\n> > > value doesn't match any of the enumerators for the scoped enum ([1]).\n> > > \n> > > Fix the warning by making the full range the default.\n> > > \n> > > https://en.cppreference.com/w/cpp/language/enum#enum_relaxed_init_cpp17\n> > > \n> > > > Fixes: 251f0534 (\"qcam: viewfinder_gl: Take color space into account for YUV rendering\")\n> > \n> > I also forgot to mention, Fixes tags should use 12 digits for the commit\n> > ID. I can also address this locally.\n> \n> Also, gcc 12.2.0 still warns about the second switch statement in the\n> same function. I'll submit a v2 of your patch to fix that as well.\n\nOf course, thanks for the investigation on this topic.\n\nRegards,\n  Marco\n\n> > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>\n> > > > ---\n> > > >  src/qcam/viewfinder_gl.cpp | 1 +\n> > > >  1 file changed, 1 insertion(+)\n> > > > \n> > > > diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\n> > > > index e2aa2470..501c5bae 100644\n> > > > --- a/src/qcam/viewfinder_gl.cpp\n> > > > +++ b/src/qcam/viewfinder_gl.cpp\n> > > > @@ -367,6 +367,7 @@ void ViewFinderGL::selectColorSpace(const libcamera::ColorSpace &colorSpace)\n> > > >  \tdouble offset;\n> > > >  \n> > > >  \tswitch (colorSpace.range) {\n> > > > +\tdefault: /* Avoid gcc11 maybe-uninitialized warning */\n> > > \n> > > Given that this is a valid behaviour for the compiler, and not a false\n> > > positive as I initially thought, I think we can drop the comment. If you\n> > > don't mind I'll also move the default one line down, just right after\n> > > the Full case.\n> > > \n> > > There's no need to submit a v2 if you're fine with these changes, I'll\n> > > apply them locally.\n> > > \n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > \n> > > >  \tcase libcamera::ColorSpace::Range::Full:\n> > > >  \t\toffset = 0.0;\n> > > >  \t\tbreak;\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 B872FC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Sep 2022 09:30:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 23B5962059;\n\tMon,  5 Sep 2022 11:30:33 +0200 (CEST)","from metis.ext.pengutronix.de (metis.ext.pengutronix.de\n\t[IPv6:2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1619D62054\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Sep 2022 11:30:32 +0200 (CEST)","from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0])\n\tby metis.ext.pengutronix.de with esmtps\n\t(TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)\n\t(envelope-from <mfe@pengutronix.de>)\n\tid 1oV8R5-0005KV-L8; Mon, 05 Sep 2022 11:30:31 +0200","from mfe by ptx.hi.pengutronix.de with local (Exim 4.92)\n\t(envelope-from <mfe@pengutronix.de>)\n\tid 1oV8R5-0005FG-83; Mon, 05 Sep 2022 11:30:31 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662370233;\n\tbh=m43PFDzern5I9Ec8lnFpNib5mAUkqEsEzpRTtBQvvH8=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=OllZufsKmjGHWY0+MqHWIAGmEVBQoWTu5UTQeZhw/rLdoa8khu/RWueYbZ5YLmnjk\n\tk9A4cojkTUmEhJTLnMCM3pxtu9nAmzcRbwPSYyo9nbsOwr8kCt5Ol5Q+31LImNXYkZ\n\t2+pzeYunMZTcpIZaOySEoZbY4UXyyOxQkrzhj+59Lo0YiRK0C7PdLH5nnU16WflxXA\n\tGU/ZXCnESHVvnDL4C049I0IuNUrgLJVcT5lvWjbIHa61QoH5to4OFg9754/qC29Ehx\n\tCIy2RTI2yfZOaK9o0LG/IBGJt2ECBPJaZ+e6jhTXJknKPT5MXmqsozIVKQD1AJFdm8\n\tza/EdEq6ZwqAA==","Date":"Mon, 5 Sep 2022 11:30:31 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220905093031.fg4536cqpg4ax7o6@pengutronix.de>","References":"<20220902141136.1342352-1-m.felsch@pengutronix.de>\n\t<YxKSWTpHNPyYmB/t@pendragon.ideasonboard.com>\n\t<YxKSmMmiFdHPu2Y9@pendragon.ideasonboard.com>\n\t<YxKZXkdPevLk3QMK@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<YxKZXkdPevLk3QMK@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","X-SA-Exim-Connect-IP":"2001:67c:670:100:1d::c0","X-SA-Exim-Mail-From":"mfe@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false","X-PTX-Original-Recipient":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-devel] [PATCH] qcam: viewfinder_gl:\n\tselectColorSpace: fix maybe uninitialized warning","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>","From":"Marco Felsch via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Marco Felsch <m.felsch@pengutronix.de>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]