Sujet : Re: VMS
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.os.linux.miscDate : 30. Jun 2025, 08:59:25
Autres entêtes
Organisation : A little, after lunch
Message-ID : <103tg4t$220b9$3@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
User-Agent : Mozilla Thunderbird
On 30/06/2025 08:51, Richard Kettlewell wrote:
The Natural Philosopher <tnp@invalid.invalid> writes:
On 30/06/2025 00:09, c186282 wrote:
These days you CAN 'usually' get away with assuming an
int is 16 bits - but that won't always turn out well.
>
I thought the default int was 32 bits or 64 bits these days.
ISTR there is a definition of uint16_t somewhere if that is what you want
>
>
A rapid google shows no one talking about a 16 bit int. Today its
reckoned to be 32 bit But if it matters, use int16_t or uint16_t
>
I can find no agreement was to what counts as a short, long, int, at all.
If it matters, use the length specific variable names.
The language spec guarantees:
char is at least 8 bits
short and int are at least 16 bits
long is at least 32 bits
long long is at least 64 bits
There are also some constraints on representation.
Server/desktop platforms usually have int=32 bits; long is a bit more
variable. It’d probably be 16 bits on a Z80 or similar where memory and
computation are in short supply.
I don't remember that at all. Short and int were 16 bits on 8 bit compilers, and long was 32 bits
But it all goes to show that if its in any way important, you should be specific as to how large your variables are.
-- “it should be clear by now to everyone that activist environmentalism (or environmental activism) is becoming a general ideology about humans, about their freedom, about the relationship between the individual and the state, and about the manipulation of people under the guise of a 'noble' idea. It is not an honest pursuit of 'sustainable development,' a matter of elementary environmental protection, or a search for rational mechanisms designed to achieve a healthy environment. Yet things do occur that make you shake your head and remind yourself that you live neither in Joseph Stalin’s Communist era, nor in the Orwellian utopia of 1984.”Vaclav Klaus