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: Why is this happening? Date: Sat, 28 Mar 2026 10:18:40 -0700 Organization: None to speak of Lines: 43 Message-ID: <874ilzx47j.fsf@example.invalid> References: <10q5046$3ec1o$2@dont-email.me> <10q523v$3e865$1@dont-email.me> <10q7bug$7vod$1@dont-email.me> <87bjg8wrgl.fsf@example.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 28 Mar 2026 17:18:41 +0000 (UTC) Injection-Info: dont-email.me; posting-host="61b5d10707f16890c8f73d8d312319a0"; logging-data="852675"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192vryudwvbiytzP9PzdNPM" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:LQpg3VhK0BRQhznSEVLBsSWGdAY= sha1:eLKA92UQG7ZOpq8YAlE6eFLbCXc= Xref: csiph.com comp.lang.c:397253 scott@slp53.sl.home (Scott Lurndal) writes: > Keith Thompson writes: >>Lawrence D’Oliveiro writes: >>> On Fri, 27 Mar 2026 10:15:23 +0100, Josef Möllers wrote: >>> >>>> diffns += 1000000000UL; >>> >>> Can you write >>> >>> diffns += 1_000_000_000UL; >>> >>> yet? >> >>Not in C. C23 introduces the apostrophe as a digit separator, copied >>from C++: >> >> diffns += 1'000'000'000UL; > > Or diffns += 1000ul * 1000ul * 1000ul; > > or diffns += 1 * NS_PER_SEC; > > with > #define NS_PER_SEC ((1000ul * 1000ul * 1000ul)) Why the "1 *"? And why two sets of parentheses? An integer constant is always of a type big enough to hold its value. The same does not hold for larger expressions. It doesn't matter in this case, since ULONG_MAX is guaranteed to be bigger than 1'000'000'000, but it can be a problem in more general cases. >>(I would have preferred underscores, but that would have conflicted >>with C++'s user-defined literals.) > > Likewise, I'd prefer the underscore. IIRC, that's what is used > in Verilog. And Python, and Perl, and Ada, and a number of other languages. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */