¬a\/b said:
easy
size_t is well-defined.
portable in my country means: i write a X language program;
that program run the same way in all machines
in the world that have a X language conform compiler
then you can argue how this program is portable
in the standard C language
#include <stdio.h>
#include <stdlib.h>
int main(void)
{size_t z=0x2FFFF, h=0xFFFFFFFF;
z=z*z;
printf("Bits(size_t) > 32 ?\n");
if(h<=0xFFFF||z<=h)
printf("No\n" );
else printf("Yes\n");
return 0;
}
because in each machine it could answer in a different way.
So what do you mean for the word "portable"? it is a meaningless word
in each machine where there are definitions like "size_t=number"
or where there are operations with size_t type variable => they are
not portable by definition (in each machine could be a different
result)
the problem is: size_t has different size each machine
but let it be size_t has 64 bits for all machine in the world
(or it is an memory only dipendent data type like a bignumber)
the problem could be for "*" function: can "*" function is the same in
all the machine and have the same result for the same operands?
the same for all other operators
the same for all UB and machine dipendent results
the same for all other "fixed all different size" data types