From patchwork Thu Jul 17 12:48:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 23834 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 01532BE175 for ; Thu, 17 Jul 2025 12:49:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9D3A168F7A; Thu, 17 Jul 2025 14:49:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pbZqq2UX"; 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 2A31868F55 for ; Thu, 17 Jul 2025 14:49:02 +0200 (CEST) Received: from mail.ideasonboard.com (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 174521E74; Thu, 17 Jul 2025 14:48:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1752756508; bh=kE0lel7rEFmQFpgrewRogEtlBHDm3vRoU017l0LwWgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pbZqq2UXCmUx+L6WXRG0hy/JkQkBZFlCRVYPwXS+KUv/ERxRl8pNmjx2SYtclibsB PteGghTIyKuJNVdRa8gpa0YGQwbeNHDM7FM+SGL2hykGm9aWU62Z7zwgXSEH8EYIP5 D4krJpKkE8vNWUV/K7rdF+0MVBGw9CghIIn0LjIs= From: Daniel Scally To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally , Laurent Pinchart Subject: [PATCH v2 1/4] libcamera: base: Wrap 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 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" Provide a wrapper for regex.h to work around the false-positive compilation errors that crop up in some versions of gcc. Suggested-by: Laurent Pinchart Signed-off-by: Daniel Scally --- Changes in v2: - New patch include/libcamera/base/meson.build | 1 + include/libcamera/base/regex.h | 13 +++++++++++++ src/libcamera/v4l2_subdevice.cpp | 8 +------- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 include/libcamera/base/regex.h diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index f28ae4d4..f84b5141 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -24,6 +24,7 @@ libcamera_base_private_headers = files([ 'message.h', 'mutex.h', 'private.h', + 'regex.h', 'semaphore.h', 'thread.h', 'thread_annotations.h', diff --git a/include/libcamera/base/regex.h b/include/libcamera/base/regex.h new file mode 100644 index 00000000..1ae21c1f --- /dev/null +++ b/include/libcamera/base/regex.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2025, Ideas on Board Oy + * + * std::regex wrapper for gcc + */ + +#pragma GCC diagnostic push +#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__ +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif +#include +#pragma GCC diagnostic pop diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 33279654..fd3b18c2 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -13,17 +13,11 @@ #include #include -#pragma GCC diagnostic push -#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__ -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -#endif -#include -#pragma GCC diagnostic pop - #include #include #include +#include #include #include