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:19:22 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: <86y0hokq51.fsf@linuxsc.com> References: <10su8cn$am9i$1@dont-email.me> <10tls2u$39j7a$1@dont-email.me> <10tm49i$9d$1@reader1.panix.com> <10tn3so$3j8hc$1@dont-email.me> <10tnj8s$pnq$1@reader1.panix.com> <10tnmk6$3os5b$1@dont-email.me> <10tr6qi$odgj$2@kst.eternal-september.org> <10tr7v0$odia$1@dont-email.me> <20260511234804.00003e35@yahoo.com> <86fr3wn2dr.fsf@linuxsc.com> <20260512222119.00002099@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Wed, 13 May 2026 02:19:23 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2494327"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GWQHL7/AilQLMKMoTAzerGl2P30LoEe0="; posting-host="ace8b6eaa328dcf44f89a3207699c4cb" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:90dtzHJQB5/KsbypurPmOAFSnaw= sha1:LSNnv9StK2Ci4RRrtnLDyILTFWc= sha256:Inm4MPFDF46mGhe8h5VgMyyI3Lf7O/yI+YT3FrWMldA= sha1:g3/Zl+pNHduxWeKZbjykvct9lgY= Xref: csiph.com comp.lang.c:398839 Michael S writes: > On Tue, 12 May 2026 07:12:00 -0700 > Tim Rentsch wrote: > >> Michael S writes: >> >>> I not just like stdint.h* >>> I also hate when C programmers define their own fixed-width >>> integer types. >>> >>> [...] >>> >>> That would raise my blood pressure: >>> typedef int32_t s32; >>> typedef uint32_t u32; >>> typedef uint8_t octet; >> >> Can you say what it is about them that you don't like? > > They increase mental load for casual reader of the code. > IMHO, for no good reason. > >> Or why you don't like them? Are the reasons the same >> in all three cases, or is octet different? > > The same in all three cases. Interesting. Thank you for the answers.