Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: how cast works?
Date: Sun, 11 Aug 2024 17:43:32 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <86y152in9n.fsf@linuxsc.com>
References:
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Mon, 12 Aug 2024 02:43:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f42e4005105099d89c60a754521770ce"; logging-data="3093877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/STdjSkSqzHSplYbmciTl/8KIfokCnavY="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:M6bssTolYFljORZpoPEds8Hsjeo= sha1:/dxKjFunH96AB6PTcEbDNLQrQzk=
Xref: csiph.com comp.lang.c:387492
Thiago Adams writes:
> I also would like to understand better why integer promotions were created.
>
> My guess..it is because the values are used in registers and there is
> no "char" size register so the values are converted in a bigger type.
> Is my guess correct?
The motivations for integer promotion rules are purely historical.
You're looking for answers in the wrong places.
Also, it would be better for your understanding of C if you would
stop thinking about what is going on at the level of actual
hardware. Doing that serves to confuse a lot more than it helps.