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: Mon, 06 Apr 2026 14:20:26 -0700 Organization: None to speak of Lines: 75 Message-ID: <877bqj4wh1.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> <86bjg72xl6.fsf@linuxsc.com> <87zf3rurp9.fsf@example.invalid> <86ldezzyx1.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 06 Apr 2026 21:20:27 +0000 (UTC) Injection-Info: dont-email.me; posting-host="c89d67d6d7dc44c8a8f559dd5aa96ee5"; logging-data="2523272"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RsEkQTYgPwQ1yNA7oQ0IT" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:qW+Q2epvCYUOoJW1/L5bRMfcoSY= sha1:ZYThn2S58LPaEfa6O7kYr3nXkEQ= Xref: csiph.com comp.lang.c:397392 Tim Rentsch writes: > Keith Thompson writes: >> Tim Rentsch writes: >>> 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@C3{B6}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)) >>>> >>>>> (I would have preferred underscores, but that would have conflicted >>>>> with C++'s user-defined literals.) >>>> >>>> Likewise, I'd prefer the underscore. >>> >>> Ditto. And there is no reason C could have allowed both, >>> and C++ be damned. >> >> (I think you omitted a "not".) > > Yes, as I explained in a followup to myself. > >> Using apostrophes is IMHO far better than either allowing two >> arbitrarily distinct syntaxes or a gratuitous incompatibility >> with C++. > > One, it is not an incompatibility. It's an upward compatible > extension. Your proposal, I think, is for C to permit both apostrophes and underscores as digit separators. I suppose that's not strictly an "incompatibility", but it would mean that any code intended to be compiled as either C or C++ cannot use underscores. Your "C++ be damned" attitude is not shared by either language committee (fortunately, IMHO). > Two, it's not gratuitous. The extension is proposed because it > provides a positive value, and I'm not the only one who thinks > so. I disagree. I've already said that I would have preferred underscores over apostrophes, but both languages now use apostrophes. If C allowed both, there would be no firm basis for deciding which to use. It would make the language slightly more complicated, with no real benefit than I can see. The only thing I can think of that might be a "positive value" is that *some* programmers would be able to use a symbol that they think looks better. It would be similar to allowing programmers to use "begin" and "end" rather than "{" and "}". I'm sure some programmers would like that, but the result would be a mess. What positive value do you think permitting underscores would add? -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */