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: Fri, 22 May 2026 21:58:26 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <86h5nyhgct.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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sat, 23 May 2026 04:58:27 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2094584"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/ymHaLkgr/3gZcmylfxU4lpucC2fLc2g="; posting-host="bfea1ad8920711d5190b1ffe56c7d4f2" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:HKuy5hKEijNhODkzEONhjk3BkXU= sha1:/gAxW/dIJl+1YA8e+aFuMm1MyBE= sha256:VSJssz8mQ7o5VjHirusF8tyqzHJXitg/ylV1RyfJAi4= sha1:Y7MkdoR7aj7WZULcV39uXtGKOS8= Xref: csiph.com comp.lang.c:399337 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.