Sujet : Re: RP2350 and Pico 2 - things missing
De : invalid (at) *nospam* invalid.invalid (Richard Kettlewell)
Groupes : comp.sys.raspberry-piDate : 29. Aug 2024, 20:33:02
Autres entêtes
Organisation : terraraq NNTP server
Message-ID : <wwvikvjp1jl.fsf@LkoBDZeT.terraraq.uk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Ahem A Rivet's Shot <
steveo@eircom.net> writes:
Richard Kettlewell <invalid@invalid.invalid> wrote:
No, it’s not necessarily wrong. If the value fits in the destination
type there’s nothing wrong with it. The results are well-defined and do
not change the value. You can look up the rules in the C standard.
>
What is wrong is making assumptions about the relative size of long
and size_t - AFAIK the standard makes no guarantees about that.
Nobody is making any such assumption here. Everyone involved knows
perfectly well that size_t could be a different size to long.
Note that it's only "wrong" if you care about portability - long
experience suggests that not caring about portability is a good way to
get bitten on the arse.
The API in question is essentially fixed in this respect. Changing these
details would break all the applications that the API supports. We just
have to live with its infelicities regardless of how much anyone
involved may care about portability.
-- https://www.greenend.org.uk/rjk/