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: Tue, 12 May 2026 19:48:40 -0700 Organization: A noiseless patient Spider Lines: 32 Message-ID: <86tssckos7.fsf@linuxsc.com> References: <10su8cn$am9i$1@dont-email.me> <10ttem6$1daks$2@dont-email.me> <10tthov$1eenk$3@kst.eternal-september.org> <10tuhmt$1o3bp$1@dont-email.me> <10tvc31$mun$1@reader1.panix.com> <10tvdne$20o1q$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 13 May 2026 02:48:41 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2494327"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192yixAWqlrDza3ojKY58d6vEeJLPD5wgU="; posting-host="ace8b6eaa328dcf44f89a3207699c4cb" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:xQ7YzcVTV9IZMR0NA4YPJpIbFxk= sha1:z32DDtd1OUSfMoNu3cg/LjXwegM= sha256:Ww0Cz0eMUDR5UCTdRtf4HzNjFNzWwGMecZGz30oOJQE= sha1:TGpCTfaNvd+iH6aRefEL4xfE4P4= Xref: csiph.com comp.lang.c:398840 Bart writes: [.. I am cutting 100ish lines as they don't bear on my response ..] > Take for example C's set of operator precedences. > > The one for the ?: operator is particularly obscure, so in an > expression like one of these: > > a + b ? c - d : e * f > a ? b ? c : d ? e : f : g > > then parentheses would be used to make things clearer. (I haven't > check these are valid, but that is the point; it is hard to see!) > > But would shouldn't people be expected to learn the rules? Why is it > OK to 'revel' in not knowing the basics here, but not when unnecessary > UBs are involved where rules are harder and which depend on runtime > inputs? If you want people to take you seriously, you need to find more compelling examples. I am both familiar with and comfortable with the syntax of C expressions, and even I would never write such expressions as the two shown above. These lines look like they were written by someone in junior high school (or these days, probably elementary school). Whether you mean to or not, this example gives the impression of offering a strawman argument, and it's only natural for people to react to that by dismissing your comments, or even dismissing them altogether. Is that what you want? To be dismissed? Or do you hope to actually communicate with people? If so I recommend looking for a better framing of your views and ideas.