{"id":25686,"url":"https://patchwork.libcamera.org/api/1.1/patches/25686/?format=json","web_url":"https://patchwork.libcamera.org/patch/25686/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20260107193607.2168539-5-barnabas.pocze@ideasonboard.com>","date":"2026-01-07T19:36:06","name":"[RFC,v1,4/5] treewide: Use character literal instead of string in some cases","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"7db3c28b5d8493ebc10ecdd2e932f722b6292341","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25686/mbox/","series":[{"id":5694,"url":"https://patchwork.libcamera.org/api/1.1/series/5694/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5694","date":"2026-01-07T19:36:02","name":"C++20 migration","version":1,"mbox":"https://patchwork.libcamera.org/series/5694/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25686/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25686/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 049CFC3274\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jan 2026 19:36:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 04DF361FC9;\n\tWed,  7 Jan 2026 20:36:18 +0100 (CET)","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 1198761FBC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jan 2026 20:36:14 +0100 (CET)","from pb-laptop.local (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A24C18BF;\n\tWed,  7 Jan 2026 20:35:52 +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=\"kbAbHakn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1767814552;\n\tbh=aj3Bd2OUFxoU+9pT4+J6qP/cg33JDnlUWxFbFuGHhqY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=kbAbHaknP06fB/SDNUY8/fnhdjgT3nBj9yaraO6kkKpw9IBoYvlhtFth9UWL96N17\n\tJOxkpX9Lx/Md3GzwbRcEEhZGwIa4m+PMEjiGL7jbIIrnXS1i21DR3O209/N836zlcv\n\tupx8u0BB6ftzxWL0ugq5nIc7Hdpvv6wUzz2ffMWU=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Naushir Patuck <naush@raspberrypi.com>","Subject":"[RFC PATCH v1 4/5] treewide: Use character literal instead of string\n\tin some cases","Date":"Wed,  7 Jan 2026 20:36:06 +0100","Message-ID":"<20260107193607.2168539-5-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260107193607.2168539-1-barnabas.pocze@ideasonboard.com>","References":"<20260107193607.2168539-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","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":"Use character literals instead of single character long strings. The main\npurpose of this change is to work around a GCC (libstdc++) bug that results\nin `-Wrestrict` warnings at certain optimization levels in C++20.\n\nLink: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/base/log.cpp               | 12 ++++++------\n src/libcamera/media_pipeline.cpp         |  6 +++---\n src/libcamera/pipeline/simple/simple.cpp |  6 +++---\n 3 files changed, 12 insertions(+), 12 deletions(-)","diff":"diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp\nindex b28217750..946bdebf0 100644\n--- a/src/libcamera/base/log.cpp\n+++ b/src/libcamera/base/log.cpp\n@@ -236,8 +236,8 @@ void LogOutput::write(const LogMessage &msg)\n \n \tswitch (target_) {\n \tcase LoggingTargetSyslog:\n-\t\tstr = std::string(log_severity_name(severity)) + \" \"\n-\t\t    + msg.category().name() + \" \" + msg.fileInfo() + \" \";\n+\t\tstr = std::string(log_severity_name(severity)) + ' '\n+\t\t    + msg.category().name() + ' ' + msg.fileInfo() + ' ';\n \t\tif (!msg.prefix().empty())\n \t\t\tstr += msg.prefix() + \": \";\n \t\tstr += msg.msg();\n@@ -245,11 +245,11 @@ void LogOutput::write(const LogMessage &msg)\n \t\tbreak;\n \tcase LoggingTargetStream:\n \tcase LoggingTargetFile:\n-\t\tstr = \"[\" + utils::time_point_to_string(msg.timestamp()) + \"] [\"\n+\t\tstr = '[' + utils::time_point_to_string(msg.timestamp()) + \"] [\"\n \t\t    + std::to_string(Thread::currentId()) + \"] \"\n-\t\t    + severityColor + log_severity_name(severity) + \" \"\n-\t\t    + categoryColor + msg.category().name() + \" \"\n-\t\t    + fileColor + msg.fileInfo() + \" \";\n+\t\t    + severityColor + log_severity_name(severity) + ' '\n+\t\t    + categoryColor + msg.category().name() + ' '\n+\t\t    + fileColor + msg.fileInfo() + ' ';\n \t\tif (!msg.prefix().empty())\n \t\t\tstr += prefixColor + msg.prefix() + \": \";\n \t\tstr += resetColor + msg.msg();\ndiff --git a/src/libcamera/media_pipeline.cpp b/src/libcamera/media_pipeline.cpp\nindex 3c5517314..26c60c36b 100644\n--- a/src/libcamera/media_pipeline.cpp\n+++ b/src/libcamera/media_pipeline.cpp\n@@ -243,11 +243,11 @@ int MediaPipeline::init(MediaEntity *source, std::string_view sink)\n \t\t\t       [](const Entity &e) {\n \t\t\t\t       std::string s = \"[\";\n \t\t\t\t       if (e.sink)\n-\t\t\t\t\t       s += std::to_string(e.sink->index()) + \"|\";\n+\t\t\t\t\t       s += std::to_string(e.sink->index()) + '|';\n \t\t\t\t       s += e.entity->name();\n \t\t\t\t       if (e.source)\n-\t\t\t\t\t       s += \"|\" + std::to_string(e.source->index());\n-\t\t\t\t       s += \"]\";\n+\t\t\t\t\t       s += '|' + std::to_string(e.source->index());\n+\t\t\t\t       s += ']';\n \t\t\t\t       return s;\n \t\t\t       });\n \ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b30b0a122..d37b76a48 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -578,11 +578,11 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \t\t\t       [](const Entity &e) {\n \t\t\t\t       std::string s = \"[\";\n \t\t\t\t       if (e.sink)\n-\t\t\t\t\t       s += std::to_string(e.sink->index()) + \"|\";\n+\t\t\t\t\t       s += std::to_string(e.sink->index()) + '|';\n \t\t\t\t       s += e.entity->name();\n \t\t\t\t       if (e.source)\n-\t\t\t\t\t       s += \"|\" + std::to_string(e.source->index());\n-\t\t\t\t       s += \"]\";\n+\t\t\t\t\t       s += '|' + std::to_string(e.source->index());\n+\t\t\t\t       s += ']';\n \t\t\t\t       return s;\n \t\t\t       });\n }\n","prefixes":["RFC","v1","4/5"]}