{"id":23834,"url":"https://patchwork.libcamera.org/api/patches/23834/?format=json","web_url":"https://patchwork.libcamera.org/patch/23834/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250717124853.2317191-2-dan.scally@ideasonboard.com>","date":"2025-07-17T12:48:50","name":"[v2,1/4] libcamera: base: Wrap <regex.h>","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"d9da09aa17fc93c65e3d6013859ca51ed6f6dcd4","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/?format=json","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23834/mbox/","series":[{"id":5293,"url":"https://patchwork.libcamera.org/api/series/5293/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5293","date":"2025-07-17T12:48:49","name":"Use regular expressions for entity name matching","version":2,"mbox":"https://patchwork.libcamera.org/series/5293/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23834/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23834/checks/","tags":{},"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 01532BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 17 Jul 2025 12:49:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D3A168F7A;\n\tThu, 17 Jul 2025 14:49:04 +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 2A31868F55\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 17 Jul 2025 14:49:02 +0200 (CEST)","from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 174521E74;\n\tThu, 17 Jul 2025 14:48:28 +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=\"pbZqq2UX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752756508;\n\tbh=kE0lel7rEFmQFpgrewRogEtlBHDm3vRoU017l0LwWgY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=pbZqq2UXCmUx+L6WXRG0hy/JkQkBZFlCRVYPwXS+KUv/ERxRl8pNmjx2SYtclibsB\n\tPteGghTIyKuJNVdRa8gpa0YGQwbeNHDM7FM+SGL2hykGm9aWU62Z7zwgXSEH8EYIP5\n\tD4krJpKkE8vNWUV/K7rdF+0MVBGw9CghIIn0LjIs=","From":"Daniel Scally <dan.scally@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v2 1/4] libcamera: base: Wrap <regex.h>","Date":"Thu, 17 Jul 2025 13:48:50 +0100","Message-Id":"<20250717124853.2317191-2-dan.scally@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20250717124853.2317191-1-dan.scally@ideasonboard.com>","References":"<20250717124853.2317191-1-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"Provide a wrapper for regex.h to work around the false-positive\ncompilation errors that crop up in some versions of gcc.\n\nSuggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\nChanges in v2:\n\n\t- New patch\n\n include/libcamera/base/meson.build |  1 +\n include/libcamera/base/regex.h     | 13 +++++++++++++\n src/libcamera/v4l2_subdevice.cpp   |  8 +-------\n 3 files changed, 15 insertions(+), 7 deletions(-)\n create mode 100644 include/libcamera/base/regex.h","diff":"diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build\nindex f28ae4d4..f84b5141 100644\n--- a/include/libcamera/base/meson.build\n+++ b/include/libcamera/base/meson.build\n@@ -24,6 +24,7 @@ libcamera_base_private_headers = files([\n     'message.h',\n     'mutex.h',\n     'private.h',\n+    'regex.h',\n     'semaphore.h',\n     'thread.h',\n     'thread_annotations.h',\ndiff --git a/include/libcamera/base/regex.h b/include/libcamera/base/regex.h\nnew file mode 100644\nindex 00000000..1ae21c1f\n--- /dev/null\n+++ b/include/libcamera/base/regex.h\n@@ -0,0 +1,13 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2025, Ideas on Board Oy\n+ *\n+ * std::regex wrapper for gcc\n+ */\n+\n+#pragma GCC diagnostic push\n+#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__\n+#pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\"\n+#endif\n+#include <regex>\n+#pragma GCC diagnostic pop\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 33279654..fd3b18c2 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -13,17 +13,11 @@\n #include <sys/ioctl.h>\n #include <unistd.h>\n \n-#pragma GCC diagnostic push\n-#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__\n-#pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\"\n-#endif\n-#include <regex>\n-#pragma GCC diagnostic pop\n-\n #include <linux/media-bus-format.h>\n #include <linux/v4l2-subdev.h>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/regex.h>\n #include <libcamera/base/utils.h>\n \n #include <libcamera/geometry.h>\n","prefixes":["v2","1/4"]}