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: Thu, 14 May 2026 06:25:20 -0700
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <86pl2yi0n3.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> <10tnnv1$3o0n8$2@dont-email.me> <10tntu0$3r6q3$1@dont-email.me> <865x4vrqgu.fsf@linuxsc.com> <10tqp0l$ktbv$1@dont-email.me> <861pfiq8xc.fsf@linuxsc.com> <10tt6u4$1adha$6@kst.eternal-september.org> <86h5oblg91.fsf@linuxsc.com> <10u1nlo$1l93k$16@dont-email.me> <86v7crjijp.fsf@linuxsc.com> <10u394q$1l93l$38@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Thu, 14 May 2026 13:25:21 +0000 (UTC)
Injection-Info: dont-email.me; logging-data="422293"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RqLCWOuIy3yxZJGcK0/8PHomfbF/y7Y4="; posting-host="d527bc7f7e7e084b0e2324cbe71ceb59"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:kcowQujM3DjTFoGPh+qi2jNlWKs= sha1:+MT9fd0xLLGkkfcxnZ9250xhFd8= sha256:djKP5i2kE274L50A+lCEiSJRVFblBmdWTJVPR+MnlmE= sha1:sUi9EDjdJabR5e7SFbx7rkOIh5M=
Xref: csiph.com comp.lang.c:398946
Janis Papanagnou writes:
> On 2026-05-13 20:00, Tim Rentsch wrote:
>
>> There is another difference worth noting. A byte is a unit of
>> storage, whereas octet is a measure of information. The word
>> byte is inherently about memory; the word octet is inherently
>> about value (eight bits of information). For this reason too
>> the name 'octet' is a better choice for a type name than 'byte'.
>
> Well, I have a slightly different view; I suppose it's cultural.
>
> I often see, specifically from the Anglo-American culture, that
> they talk about, say, "8 bits"; and this has partly culturally
> also spread across the ocean. - Here we try to distinguish the
> units and the "metal"; the latter are formally substantives and
> written with a capital letter. So we have units of "1 bit" or
> "5 bit" entities (no 's' at the end). But seen as "metal" we
> speak about "one Bit" or "five Bits" - although it's somewhat
> quirky to imagine a thing that is physically "5 Bit", mostly it
> is more accurate to say it's an entity of "5 bit" - and similar
> with "1 byte". Because we use that also as _unit_ for 8 bit
> entities. It gets complicated by us addressing the unit 'bit'
> by a name, which is then "Bit". So the more accurate forms for
> the _units_ are 5 bit or 8 byte. - As said, we may culturally
> see that differently, and colloquially you nowadays also often
> hear "5 Bits" or "8 Bytes" (as pluralized substantive), so it's
> cumbersome to argue about that. - Only that "byte" is also a
> unit (and not necessarily associated with memory) seems to be
> our difference in how we view that.
I don't know if I see what you're getting at here. My writing
follows standard usage in American English. Sometimes the names
of units are capitalized but for the most part they aren't. The
names of units are singular or plural when used as nouns (1 bit,
2 bits), but singular when used as adjectives (16-bit int).
There may be exceptions to those rules, I haven't thought about
it deeply.
My main point is that "byte" and "octet" are talking about
different kinds of things. A computer might have 64k bytes of
RAM, but normally I wouldn't (and I think normally other people
wouldn't) say that a computer has 64k octets of RAM. We might
say a computer has enough RAM to _hold_ 64k octets, but not that
it _has_ 64k octets. There's a semantic incongruity in the
latter case. Do you see what I mean?