Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: printf and time_t Date: Thu, 05 Feb 2026 11:05:36 -0800 Organization: None to speak of Lines: 26 Message-ID: <87wm0r80zj.fsf@example.invalid> References: <10jfol6$2u6r8$1@news.xmission.com> <87qzs1gliq.fsf@example.invalid> <20260108012620.000041a9@yahoo.com> <87bjj5gei4.fsf@example.invalid> <20260108023846.0000260c@yahoo.com> <10jpi8h$15aea$1@dont-email.me> <20260109141859.00004f22@yahoo.com> <10jv3rb$15aea$2@dont-email.me> <20260111132015.000026ad@yahoo.com> <86zf6kkjw0.fsf@linuxsc.com> <20260111235104.00001463@yahoo.com> <86ms1pj0bc.fsf@linuxsc.com> <10ltjjt$1o4pk$1@dont-email.me> <865x8cio5y.fsf@linuxsc.com> <10lvt1s$2fu8f$1@dont-email.me> <10lvul0$2gps1$1@dont-email.me> <10m024m$2hqvi$1@dont-email.me> <10m091i$2kiff$1@dont-email.me> <10m0b0g$2l6li$1@dont-email.me> <10m1vl7$35irp$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 05 Feb 2026 19:05:37 +0000 (UTC) Injection-Info: dont-email.me; posting-host="d063e519f8c8ebf42097b88d5c7b8b46"; logging-data="3628530"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SBWf0ZLcj5AplkCs9Nj/G" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:u3FdYMFZuuwRJEMle/Opi18BiKs= sha1:AOTLzbGnwXnFRlIw+iPNl0isXkI= Xref: csiph.com comp.lang.c:396610 David Brown writes: [...] > How many people do you know who have actually written and use a > C11 print system using _Generic and variadic macros? I don't know > any. (I've written simple examples as proofs of concept, posted > in this group, but not for real use.) It turns out that people > /don't/ have to have workarounds. "printf" has its limitations - > there's no doubt there. But it is good enough for most people > and most uses. I recently played around with an attempted framework using _Generic. The goal was to be able to write something like print(s(x), s(y), s(z)); where x, y, and z can be of more or less arbitrary types (integer, floating-point char*). The problem I ran into was that only one of the generic associations is evaluated (which one is determined at compile time), but *all* of them have to be valid code. There's a proposal to change this for C 202y. I didn't spend a lot of time on it. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */