On 2026-01-07 09:12, Christos Zoulas via tz wrote:
Hello,

The new tzcode uses static_assert() with no message which is a c2x extension. clang does not like that by default (without specifying - std=gnu2x).

/home/source/ab/HEAD-llvm/src/lib/libc/time/private.h:1017:52: error: '_Static_assert' with no message is a C2x extension [-Werror,-Wc2x- extensions]
               || TIME_T_MAX >> (TYPE_BIT(time_t) - 2) == 1);
                                                           ^
                                                           , ""

Which clang? I'm not seeing that diagnostic with clang version 20.1.8 (Fedora 20.1.8-4.fc42).

Also, that code appears on line 994 in upstream tzcode, whereas your diagnostic says line 1017. So I suppose you're using a modified private.h? The upstream private.h contains this:

/* For pre-C23 compilers, a substitute for static_assert. Some of these compilers may warn if it is used outside the top level. */
#if __STDC_VERSION__ < 202311 && !defined static_assert
# define static_assert(cond) extern int static_assert_check[(cond) ? 1 : -1]
#endif

so you might use 'clang -E' to see why that isn't working for you as it should.

Reply via email to