[{"id":3680804,"web_url":"http://patchwork.ozlabs.org/comment/3680804/","msgid":"<bmm.hhuoen7ku8.gcc.gcc-TEST.forge-bot.48.5632.CMT@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T18:23:05","subject":"Re: [PATCH v1 0/1] libstdc++: Implement debug format for strings and\n charcters formatters [PR109162]","submitter":{"id":93212,"url":"http://patchwork.ozlabs.org/api/people/93212/","name":"Lichenor Forgejo Bot via Sourceware Forge","email":"forge-bot+forge-bot@forge-stage.sourceware.org"},"content":"Sent patch series version 1 containing 1 patches to gcc-patches mailing list <gcc-patches@gcc.gnu.org>.\n[Cover letter](https://inbox.sourceware.org/gcc-patches/bmm.hhuod45t0o.gcc.gcc-TEST.tkaminsk.48.1.0@forge-stage.sourceware.org)\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/48#issuecomment-5632","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g17C508NLz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:33:21 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 328504374282\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:33:19 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 88B884422AF5\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:23:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 7510D43459\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:23:06 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 328504374282","OpenDKIM Filter v2.11.0 sourceware.org 88B884422AF5"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 88B884422AF5","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 88B884422AF5","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776882187; cv=none;\n b=woc2wSSeRjLIUN8DJeUX5Ug+50BxuVa9FyOwy+rMl736SvppyeSBMkq6W+jSDK+BllK/d1EL/nLWQGwe0QhmTRNygl3EQoccBgU/TVXEjdCXJXkKIzhZz6y8xFrtLgeTBGexA0Wn/3dvgSXUuF6Nbo4rHP0OQ5IFh+kFhpneWPQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776882187; c=relaxed/simple;\n bh=ZU5/crOtu39ALkCAwDxA+Y3zD8BPbdP4LsGDSa+lx68=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=Kpd1Inh3RZ309P/BPCBs+ovVTiWT76bIN0F6iO9lMObWcgGb9TXlHdlEiqCquJpvC/O3fqo6RVP2Nmhs/EsO1jvA/VGD3I2ezroEs6LXJZ6gn+R8Y0l4W7yxwQezfsjEwTH/z9kT37+NqOgbzakjxsqBI43LJVm976FqGHc0BDw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/1] libstdc++: Implement debug format for strings and\n charcters formatters [PR109162]","From":"Lichenor Forgejo Bot via Sourceware Forge\n <forge-bot+forge-bot@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Wed, 22 Apr 2026 18:23:05 +0000","Message-ID":"\n <bmm.hhuoen7ku8.gcc.gcc-TEST.forge-bot.48.5632.CMT@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuod45t0o.gcc.gcc-TEST.tkaminsk.48.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/48","X-Comment":"\n https://forge.sourceware.org/gcc/gcc-TEST/pulls/48#issuecomment-5632","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680811,"web_url":"http://patchwork.ozlabs.org/comment/3680811/","msgid":"<bmm.hhuof9jf7o.gcc.gcc-TEST.tkaminsk.48.1.SUMMARY@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T18:23:41","subject":"[SUMMARY] Re: [PATCH v1 0/1] libstdc++: Implement debug format for\n strings and charcters formatters [PR109162]","submitter":{"id":93223,"url":"http://patchwork.ozlabs.org/api/people/93223/","name":"tkaminsk via Sourceware Forge","email":"forge-bot+tkaminsk@forge-stage.sourceware.org"},"content":"This is a summary of discussions relative to the merge request created by (tkaminsk) <tkaminsk@gcc.gnu.org> titled\nlibstdc++: Implement debug format for strings and charcters formatters [PR109162]\nsince its creation.\n\nDescription: This patch implements part P2286R8 that specified debug (escaped)\nformat for the stings and characters sequecenes. This include both\nhandling of the '?' formatt specifier and set_debug_format member.\n\nTo indicate partial support we define __glibcxx_format_ranges macro\nvalue 1, without defining __cpp_lib_format_ranges.\n\nWe provide two separate escaping routines depending on the literal\nencoding for the corresponding character types. If the charcter\nencoding we follow the specification for the standard\n(__format::__write_escaped_unicode).\nFor other encodings, we escape only characters in range [0x00, 0x80),\ninterpreting them as ACII values: [0x00, 0x20), 0x7f and  '\\t', '\\r',\n'\\n', '\\\\', '\"', '\\'' are escaped. We assume every character outside\nthis range is printable (__format::_write_escpaed_ascii).\nIn particular we do not yet implement special handling of shift\nsequences.\n\nFor Unicode escaping a new __escape_edges table is introduced,\nthat encodes information if character belongs tp General_Category\nthat is escaped by the standard (Control or Other). This table\nis generated from DerivedGeneralCategory.txt provided by Unicode.\nOnly boolean flag is preserved to reduce the number of entires.\nThe additional rules for escaping are handled by __should_escape_unicode.\n\nWhen width of precision is specified, we emit escaped string to the temporary\nbuffer and format the resulting string according ot the format spec.\nFor characters fixed size stack buffer, for which a new _Fixedbuf_sink is\nintroduced. For strings, we user _Str_sink and to avoid allocations,\nwe compute the estimated size of (possibly truncated) input, and if it is\nlarger than width field we print directly.\n\nFinally this patch corrects handling of UTF-32LE and UTF32-BE\nin __unicode::__literal_encoding_is_unicode<_CharT>, and now they\nare properly recognized as unicode.\n\ncontrib/ChangeLog:\n\n\t* unicode/README:\n\tMentioned `DerivedGeneralCategory.txt`\n\t* unicode/gen_libstdcxx_unicode_data.py:\n\tGeneration __escape_edges table from DerivedGeneralCategory.txt.\n\tUpdate file name in comments.\n\t* unicode/DerivedGeneralCategory.txt:\n\tCopy of file distrubuted by Unicode Consortium\n\tftp://ftp.unicode.org/Public/UNIDATA/extracted/DerivedGeneralCategory.txt.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/chrono_io.h (_GLIBCXX_WIDEN_, _GLIBCXX_WIDEN)\n\t(__detail::_Widen): Moved to std/format file.\n\t* include/bits/unicode-data.h:\n\tRegnerate using contrib/unicode/gen_libstdcxx_unicode_data.py.\n\t* include/bits/unicode.h (__unicode::_Utf_iterator::_M_units)\n\t(__unicode::__should_escape_category): Define.\n\t(__unicode::__literal_encoding_is_unicode<_CharT>):\n\tCorrected handing for UTF-16 and UTF-32 with \"LE\" or \"BE\" suffix.\n\t* include/bits/version.def:\n\tDefine __glibcxx_format_ranges without corresponding std name.\n\t* include/bits/version.h: Regenerate.\n\t* include/std/format (_GLIBCXX_WIDEN_, _GLIBCXX_WIDEN):\n\tMoved from include/bits/chrono_io.h.\n\t(__format::_Term_char, __format::_Escapes, __format::_Separators)\n\t(__format::__should_escape_ascii, __format::__should_escape_unicode)\n\t(__format::__write_escape_seq, __format::__write_escaped_char)\n\t(__format::__write_escaped_acii, __format::__write_escaped_unicode)\n\t(__format::__write_escaped): Define.\n\t(__formatter_str::_S_format): Extracted truncation of character\n\tsequences.\n\t(__formatter_str::format): Handle _Pres_esc.\n\t(__formatter_int::_M_do_parse): Parse '?' if__glibcxx_format_ranges\n\tif set.\n\t(__formatter_int::_M_format_character_escaped): Define.\n\t(formatter<_CharT, _CharT>::format, formatter<char, wchar_t>::format):\n\tHandle _Pres_esc.\n\t(__formatter_str::set_debug_format, formatter<...>::set_debug_format)\n\tGuard with __glibcxx_format_ranges.\n\t(__format::_Fixedbuf_sink): Define.\n\t* testsuite/std/format/debug.cc: New test.\n\t* testsuite/std/format/parse_ctx.cc (escaped_strings_supported):\n\tDefine to true if __glibcxx_format_ranges is defined.\n\t* testsuite/std/format/string.cc (escaped_strings_supported):\n\tDefine to true if __glibcxx_format_ranges is defined.\n\nThe full and up to date discussion can be found at https://forge.sourceware.org/gcc/gcc-TEST/pulls/48\n\nThe merge request has been closed without being merged directly on the forge repository.\n\nOn 2025-04-04 07:32:50+00:00, (tkaminsk) <tkaminsk@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/format\n> @@ -1300,0 +1639,4 @@\n> +\n> +\t  const basic_string_view<_CharT> __escaped = __sink.view();\n> +\t  size_t __estimated_width;\n> +\t  if (__escaped[1] == '\\\\') // escape sequence\nUse _Esc::_S_bshlash()[0] for consistency.\n\nOn 2025-04-04 09:45:22+00:00, (tkaminsk) <tkaminsk@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/format\n> @@ -972,3 +1267,3 @@\n>  \tif (*__first == 's')\n>  \t  ++__first;\n> -#if __cpp_lib_format_ranges\n> +#if __glibcxx_format_ranges\nAdd `// C++ >= 23 && HOSTED` comment everywhere.\n\n\nOn 2025-04-11 09:40:49+00:00, (tkaminsk) wrote:\n\nMerged as r15-9377-g3b33d792cf1e4d2ea3d36d3ad403cbb452243cd8.\n\n\nOn 2026-04-22 18:22:00+00:00, Lichenor Forgejo Bot (forge-bot) wrote:\n\n<!-- pr-new-version -->\nVersion 1 of this pull request has been stored. It includes the following commits:\n- libstdc++: Implement debug format for strings and charcters formatters [PR109162] - f326a82fe007b4ae688d50ac17be5d33737aad6d\n\n\n\nOn 2026-04-22 18:23:05+00:00, Lichenor Forgejo Bot (forge-bot) wrote:\n\nSent patch series version 1 containing 1 patches to gcc-patches mailing list <gcc-patches@gcc.gnu.org>.\n[Cover letter](https://inbox.sourceware.org/gcc-patches/bmm.hhuod45t0o.gcc.gcc-TEST.tkaminsk.48.1.0@forge-stage.sourceware.org)","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g17K61mFWz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:38:34 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 68595429ED11\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:38:32 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id E72B94423335\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:23:41 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id BF96D43455\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:23:41 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 68595429ED11","OpenDKIM Filter v2.11.0 sourceware.org E72B94423335"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org E72B94423335","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org E72B94423335","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776882222; cv=none;\n b=b4KDJZ0rOM7g+VmuDiT2w4EVJ+d8o3uGXfo3rrGIX7r82QOXWkf8zfhgwzVw0cbH8lT2yNphIgCbK3tRlNeymdIViLvhB39EwrFWFe5ZCR5zLAI9NO4XbVAL3FFA/84V3xgHFzlTaClKlPWqsxrJvWMo8TEldQFBXZbgEV+00kU=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776882222; c=relaxed/simple;\n bh=0ZzBgi7ykUs4MLeoI4pwJINhcsWrLD3o9f8JJTXLWoM=;\n h=Subject:From:To:Message-ID:MIME-Version:Date;\n b=aFfhiPOtPZlO/kWMUis5+W1z5cf04WgxV3Ps3F2/VrHqwvJzaf9LLIPbqKNWscLwyQaW+/G9DpvokNHFcq8Wc+AUylVrfIwNN10XLQ5lZ7LW1Y1T0Jjdo8Tq9lhBlC+GbokjFS+r7xoW0RoKAgTnfSx7mMnSDle0uN9UHo53N8A=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"[SUMMARY] Re: [PATCH v1 0/1] libstdc++: Implement debug format for\n strings and charcters formatters [PR109162]","From":"tkaminsk via Sourceware Forge\n <forge-bot+tkaminsk@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","In-Reply-To":"\n <bmm.hhuod45t0o.gcc.gcc-TEST.tkaminsk.48.1.0@forge-stage.sourceware.org>","Message-ID":"\n <bmm.hhuof9jf7o.gcc.gcc-TEST.tkaminsk.48.1.SUMMARY@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/48","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","Date":"Wed, 22 Apr 2026 18:23:41 +0000 (UTC)","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}}]