Похожие чаты

Is the inttypes.h header builtin or it's in libc? How about

stddef.h?

22 ответов

49 просмотров

Both belongs to the C standard library

You don't have to link anything to use it

Mahdi- Автор вопроса
Mahdi- Автор вопроса
Thomas
You don't have to link anything to use it

The types are literally a bunch of typedefs. LOL.

Mahdi
screenshot The types are literally a bunch of typedefs. LOL.

What did you expect? Why is that surprising to you?

Mahdi- Автор вопроса
BinaryByter
What did you expect? Why is that surprising to you...

"Size of C types like int, short, long are platform-dependent"

Mahdi
"Size of C types like int, short, long are platfor...

But stdint types are not. uint8_t is literally 8 bits without sign same with int16_t, uint24_t or int32_t, naming someones

Mahdi
"Size of C types like int, short, long are platfor...

And these .h files are platform-dependent too

Mahdi- Автор вопроса
Jose TheFantasyClub
But stdint types are not. uint8_t is literally 8 ...

I know. I'm saying if shot, int, long are platform-dependent type how can a combination of them make a non-platform dependent type?

Mahdi
I know. I'm saying if shot, int, long are platform...

Because the .h file is different for each platform

Thomas
uint24_t 👀

let me check it, i'm writing without proofing

Mahdi
I know. I'm saying if shot, int, long are platform...

So on platforms where int is 4 bytes, int32_t can use it, on platforms where int isn't 4 bytes, int32_t must use something else

Thomas
uint24_t 👀

yep, checked and wrong from my part: The definitions in <stdint.h> put requirements on the types it names, so int16_t must have a width of exactly 16, and INT16_MAX must be 32767. Butthere are no equivalent requirements on types such as int24_t or int128_t. So it is possible for int24_t to be a 16 bit type, or int_least128_t to be a 64 bit type. This is not in the interests of either the implementer or the user of an implementation. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n851.htm

Mahdi- Автор вопроса
Thomas
So on platforms where int is 4 bytes, int32_t can ...

Explain this platform dependency. What exactly do you mean by that? Is it related to OS? ARCH? 32bit or 64bit? What are those platforms that make exceptions?

Mahdi- Автор вопроса
Thomas
OS+ARCH

Wdym by arch? arm/x86_64/powerpc or 32bit/64bit?

Mahdi
Explain this platform dependency. What exactly do ...

macOS has a different size for long than windows / linux I think

Mahdi
Explain this platform dependency. What exactly do ...

Byte didn't always mean 8bits, so some platforms used different widths when referring to bytes, but nowadays it is more or less normalized that byte means 8bits

Jose TheFantasyClub
But stdint types are not. uint8_t is literally 8 ...

One more detail - these are minimally guaranteed sizes of each datatype. The maximum is another thing

Похожие вопросы

Обсуждают сегодня

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
any reference of this implementation?
BitBuddha
29
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
11
Ⓐrtto, [4/23/24 7:02 PM] Please explain more fully how it is not working exactly, and what are the steps you are taking, and what error messages come or what happens. Ⓐrtto, ...
Ezza Kezza
2
sounds like people have lost their kaspa on tradeogre... does this mean tradeogre not trustworthy?
Ezza Kezza
15
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
11
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
Карта сайта