is it a guaranteed by the standard that this is true?
Like if for example I am using windows, int and long have same size will it be guaranteed that if int32_t is for example an alias to a signed int it is guaranteed that uint32_t is an alias to unsigned int and not unsigned long.
I need this to avoid UB while type aliasing.
>Solution :
is
uintXX_tguaranteed to be the unsigned type ofintXX_t
No.
is it a guranteed by the standard that this is true.
No.
If you find an implemetation where this is not true, I hope someone from the forum gives you a beer. DeathStation 9000 doesn’t count, please do not run your code on it.
I need this to avoid UB while type aliasing.
Just write an assertion to fail the compilation and write your software assuming it’s true.