Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Safety of casting from 'long' to 'int'
Date: Sun, 24 May 2026 04:37:36 -0700
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <868q99f37j.fsf@linuxsc.com>
References: <10su8cn$am9i$1@dont-email.me> <10tvc31$mun$1@reader1.panix.com> <10tvdne$20o1q$2@dont-email.me> <10u1j2h$1l93l$31@dont-email.me> <10u21v6$ev2$1@reader1.panix.com> <10u36pv$1l93k$18@dont-email.me> <10u4bs5$9ifk$2@dont-email.me> <10ug8fn$2skgp$1@dont-email.me> <10ug9sm$2sp0q$1@dont-email.me> <10ughgg$2v279$1@kst.eternal-september.org> <10uhe6m$36a89$1@dont-email.me> <10uhkjm$10o6i$1@paganini.bofh.team> <86h5nyhgct.fsf@linuxsc.com> <10urh4l$228p5$2@kst.eternal-september.org> <864ijyha9n.fsf@linuxsc.com> <10us23t$27egk$2@kst.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sun, 24 May 2026 11:37:37 +0000 (UTC)
Injection-Info: dont-email.me; logging-data="493264"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DJlMXU28rV2Z4WijHeJ9RQ7voO2uPWmQ="; posting-host="b5598a003ee62daee138155580deb387"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:PM0q1RjoHa8Gr1NL1EIx7xdDvYQ= sha1:lCJ7VYSutjJAp6deTE/6yUhXis8= sha256:XQ4Y4QuDRH0o5X8RNuW7X1gI4pwgWm7ympQYriROvWc= sha1:3wR8heCpiju+BbomWyNg66d0fnk=
Xref: csiph.com comp.lang.c:399397
Keith Thompson writes:
> Tim Rentsch writes:
>
>> Keith Thompson writes:
>>
>>> Tim Rentsch writes:
>>>
>>>> antispam@fricas.org (Waldek Hebisch) writes:
>>>>
>>>>> [...] for some time there was a belief that correct and full BNF
>>>>> for C was impossible to give or too messy.
>>>>
>>>> I find this statement hard to believe. There is nothing especially
>>>> difficult about a syntax for the C language. There is of course the
>>>> well-known problem with typedef names, but that has long been
>>>> understood to be unresolvable in any context-free way (and so cannot
>>>> be dealt with in BNF). Earlier versions of C (pre-K&R) had other
>>>> syntax for some constructs, and maybe that was the issue. I'm at a
>>>> loss to understand how people could have thought a BNF for C, for
>>>> the post K&R version of the language, would be challenging or
>>>> difficult.
>>>
>>> I'm having trouble figuring out what you mean here. You acknowledge
>>> that typedefs make a full BNF grammar for C impossible, and then
>>> you say that it's not challenging or difficult.
>>
>> Because I think the problem with typedef names is orthogonal to
>> what Waldek was saying. The problem with typedef names is not
>> solvable in a context-free grammar, and that is just as true today
>> as it was 50 years ago. The syntax I am talking about is C syntax
>> without regard to the problem with typedef names.
>
> I still don't understand your point. [...]
Yes, I can see that.
By the way, it wasn't a point, it was only an explanation. I'm
sorry that it wasn't more understandable for you.