[{"id":32556,"web_url":"https://patchwork.libcamera.org/comment/32556/","msgid":"<20241205202845.GJ21014@pendragon.ideasonboard.com>","date":"2024-12-05T20:28:45","subject":"Re: [PATCH v2 2/2] libcamera: utils: StringSplitter: Add\n\t`operator==`","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Thu, Dec 05, 2024 at 09:23:06AM +0000, Barnabás Pőcze wrote:\n> If `cpp_debugstl` is enabled in the build configuration, then\n> libstdc++ will try to use `==` on operators in certain cases\n> to carry out extra checks. This leads to build failures because\n> `StringSplitter::iterator` has no `operator==`.\n> \n> Implement `operator==`, and express `operator!=` in terms of it.\n> \n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nCould I ask you to have a look at enabling cpp_debugstl in CI ? I think\nyou should have the necessary permissions to use the runners on\ngitlab.fdo, so testing should only be a matter of cloning the libcamera\nand libcamera-ci tress in your user namespace, pointing the libcamera CI\nconfiguration to libcamera-ci, and giving it a try. You can send patches\nfor the CI to this list, with a [libcamera-ci] or similar prefix.\n\n> ---\n>  include/libcamera/base/utils.h | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h\n> index c4a06660..780aeda6 100644\n> --- a/include/libcamera/base/utils.h\n> +++ b/include/libcamera/base/utils.h\n> @@ -205,9 +205,14 @@ public:\n>  \t\titerator &operator++();\n>  \t\tstd::string operator*() const;\n>  \n> +\t\tbool operator==(const iterator &other) const\n> +\t\t{\n> +\t\t\treturn pos_ == other.pos_;\n> +\t\t}\n> +\n>  \t\tbool operator!=(const iterator &other) const\n>  \t\t{\n> -\t\t\treturn pos_ != other.pos_;\n> +\t\t\treturn !(*this == other);\n>  \t\t}\n>  \n>  \tprivate:","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 26057BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Dec 2024 20:29:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EFA16611B;\n\tThu,  5 Dec 2024 21:28:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45C726608C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Dec 2024 21:28:58 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2845B7E2;\n\tThu,  5 Dec 2024 21:28:29 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SLUBjMNa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733430509;\n\tbh=EerMW2TxhOytCeIKE4pvIpWfbzTztNOUS3Kuk1zrprg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SLUBjMNazDDACKEsy2k+gvoyhxJo1h+BBp0O0p/d7r10lmZiywvke0MZRH1o9ptpx\n\tblxwWIawrOmjYZHM9z6Gqv8ltK+/QtBxj8rEmH4ALCUS5+6Dl8faYb6tgdn5qx6mhj\n\tkc1ceCpc+vcwBLaNKkwInV/13SwAT79uNdNIuBXY=","Date":"Thu, 5 Dec 2024 22:28:45 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 2/2] libcamera: utils: StringSplitter: Add\n\t`operator==`","Message-ID":"<20241205202845.GJ21014@pendragon.ideasonboard.com>","References":"<20241205092258.1058077-1-pobrn@protonmail.com>\n\t<20241205092258.1058077-2-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20241205092258.1058077-2-pobrn@protonmail.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>"}}]