From bdfe08a51478114908fd9f085c73ab0c44de2656 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 13 Sep 2024 19:55:35 -0500 Subject: [PATCH 1/2] xo-indentlog: bugfix: increase buf size to exclude possible overrun --- include/xo/indentlog/timeutil/timeutil.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xo/indentlog/timeutil/timeutil.hpp b/include/xo/indentlog/timeutil/timeutil.hpp index f1b2a938..1a2a0240 100644 --- a/include/xo/indentlog/timeutil/timeutil.hpp +++ b/include/xo/indentlog/timeutil/timeutil.hpp @@ -259,7 +259,7 @@ namespace xo { auto [t0_tm, t0_usec] = utc_split_tm(t0); /* no std::format in clang11 afaict */ - char usec_buf[8]; + char usec_buf[15]; snprintf(usec_buf, sizeof(usec_buf), "%06d", t0_usec); From dfccfc56c1c676c70e95aa6ae8cc10412899b974 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 13 Sep 2024 22:40:54 -0500 Subject: [PATCH 2/2] xo-indentlog: handle gcc 13.3 --- include/xo/indentlog/print/function.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/xo/indentlog/print/function.hpp b/include/xo/indentlog/print/function.hpp index 095df5c7..9a6e56ee 100644 --- a/include/xo/indentlog/print/function.hpp +++ b/include/xo/indentlog/print/function.hpp @@ -147,7 +147,12 @@ namespace xo { /* clang footnote like [CharT = char] instead of [with CharT = char] */ std::size_t p = s.find(" ["); #else +# if (__GNUC__ > 13) || ((__GNUC__ == 13) && (__GNUC_MINOR__ >= 3)) + /* gcc footnote like [CharT = char] instead of [with CharT = char] starting w/ gcc 13.3 (approximately ?)*/ + std::size_t p = s.find(" ["); +# else std::size_t p = s.find(" [with "); +# endif #endif return s.substr(0, p);