On Wed, Jan 29, 2025 at 02:54:56PM +0000, Stuart Henderson wrote:
> On 2025/01/29 14:16, Theo Buehler wrote:
> > This builds on current and with llvm 19. Rather than pulling in large
> > patches, let's just udpate it.
> >
> > I haven't tried to figure out how to use this.
>
> Could do with update-patches as well - ok.
d'oh. thanks.
> I have a diff for a couple of the 64-bit time_t issues but I don't
ok tb
> remember what to do with sscanf..
I'm not sure there's a super clean solution. Maybe this is acceptable?
sscanf(str, sizeof(time_t) == sizeof(long long) ? "%lld" : "%ld", &t);
>
> Index: patches/patch-src_command_executor_cc
> ===================================================================
> RCS file: patches/patch-src_command_executor_cc
> diff -N patches/patch-src_command_executor_cc
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_command_executor_cc 29 Jan 2025 14:53:47 -0000
> @@ -0,0 +1,16 @@
> +Index: src/command_executor.cc
> +--- src/command_executor.cc.orig
> ++++ src/command_executor.cc
> +@@ -509,10 +509,10 @@ execute_sql(exec_context& ec, const std::string& sql,
> + snprintf(row_count_buf,
> + sizeof(row_count_buf),
> + ANSI_BOLD("%'d") " row%s matched in " ANSI_BOLD(
> +- "%ld.%03ld") " seconds",
> ++ "%lld.%03ld") " seconds",
> + row_count,
> + row_count == 1 ? "" : "s",
> +- diff_tv.tv_sec,
> ++ (long long)diff_tv.tv_sec,
> + std::max((long) diff_tv.tv_usec / 1000, 1L));
> + retval = row_count_buf;
> + if (dls.has_log_time_column()) {
> Index: patches/patch-src_ptimec_hh
> ===================================================================
> RCS file: patches/patch-src_ptimec_hh
> diff -N patches/patch-src_ptimec_hh
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_ptimec_hh 29 Jan 2025 14:53:47 -0000
> @@ -0,0 +1,21 @@
> +Index: src/ptimec.hh
> +--- src/ptimec.hh.orig
> ++++ src/ptimec.hh
> +@@ -331,7 +331,7 @@ ftime_s(char* dst, off_t& off_inout, ssize_t len, cons
> + {
> + time_t t = tm2sec(&tm.et_tm);
> +
> +- snprintf(&dst[off_inout], len - off_inout, "%ld", t);
> ++ snprintf(&dst[off_inout], len - off_inout, "%lld", (long long)t);
> + off_inout = strlen(dst);
> + }
> +
> +@@ -389,7 +389,7 @@ ftime_q(char* dst, off_t& off_inout, ssize_t len, cons
> + {
> + time_t t = tm2sec(&tm.et_tm);
> +
> +- snprintf(&dst[off_inout], len - off_inout, "%lx", t);
> ++ snprintf(&dst[off_inout], len - off_inout, "%llx", (long long)t);
> + off_inout = strlen(dst);
> + }
> +