From e569552eb9766bc663871b6f3cb203a77e83503c Mon Sep 17 00:00:00 2001 From: Sean Kurtz Date: Wed, 25 Nov 2026 12:52:38 -0600 Subject: C23: constexpr internal linkage, naming and trailing commas; clangd at C23 A constexpr at file scope has external linkage, so the CSI offsets and CSI_MAX_CALLS now say static. The naming check gets the C23 spellings wrap the check itself: typed constants keep the macro case, and a local static constexpr table keeps the variable case. .clangd says -std=c23, which it still did not, so the editor could not read constexpr at all. --- src/exec.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/exec.c') diff --git a/src/exec.c b/src/exec.c index fbc46ba..c0267a8 100644 --- a/src/exec.c +++ b/src/exec.c @@ -215,10 +215,14 @@ static int eval_time(const node *n, unsigned flags) { getrusage(RUSAGE_SELF, &s1); getrusage(RUSAGE_CHILDREN, &c1); bool posix = n->u.time.posix; - long long self[2] = {tv_diff(s0.ru_utime, s1.ru_utime), - tv_diff(s0.ru_stime, s1.ru_stime)}; - long long kids[2] = {tv_diff(c0.ru_utime, c1.ru_utime), - tv_diff(c0.ru_stime, c1.ru_stime)}; + long long self[2] = { + tv_diff(s0.ru_utime, s1.ru_utime), + tv_diff(s0.ru_stime, s1.ru_stime), + }; + long long kids[2] = { + tv_diff(c0.ru_utime, c1.ru_utime), + tv_diff(c0.ru_stime, c1.ru_stime), + }; static const char *const label[2] = {"user", "sys"}; out_flush(&out1); put_time("real", tv_diff(t0, t1), posix); @@ -877,7 +881,10 @@ static void assign_temp(const simple_cmd *sc) { */ static bool tag_prefix_begin(const simple_cmd *sc, tag_mode saved[3]) { static const char *const name[3] = { - "_TAG_REDIR_IN=", "_TAG_REDIR_OUT=", "_TAG_REDIR_ERR="}; + "_TAG_REDIR_IN=", + "_TAG_REDIR_OUT=", + "_TAG_REDIR_ERR=", + }; bool any = false; memcpy(saved, tag_redir, sizeof tag_redir); for (int i = 0; i < sc->nassign; i++) { -- cgit