Sujet : Re: RP2350 and Pico 2 - things missing
De : steveo (at) *nospam* eircom.net (Ahem A Rivet's Shot)
Groupes : comp.sys.raspberry-piDate : 29. Aug 2024, 14:05:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240829140519.0f9feb077b892bb9521f06c6@eircom.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0)
On Thu, 29 Aug 2024 13:43:11 +0100
Richard Kettlewell <
invalid@invalid.invalid> wrote:
Ahem A Rivet's Shot <steveo@eircom.net> writes:
There are always the int<n>_t types for when size matters.
Life is not always that simple and declaring how things ‘should’ be does
not fix a single line of code.
Very true - horse, water, drink.
One of the public APIs we support largely uses ‘long’ and ‘unsigned
long’ for integral values, which causes occasional issues with our
cross-platform code. For example ‘unsigned long’ has the same size as
‘size_t’ on Linux, but not on 64-bit Windows.
Which is why putting assigning the value of a size_t to an unsigned
long or vice-versa is wrong. But hey early C programmers used to store
pointers in ints (there's a moan about it in first edition K&R *that*
early).
-- Steve O'Hara-SmithOdds and Ends at http://www.sohara.org/For forms of government let fools contestWhate're is best administered is best - Alexander Pope