I want to print out a variable for type size_t in c but it appears that size_t is aliased to different variable types on different architextures. For example on one machine (64-bit) the following code does not throw any warmings:
size_t size = 1;
printf("the size is %ld", size);
but on my other machine (32_bit) the above code produces the following warning message:
warning: format '%ld' expects type 'long int *', but argument 3 has type 'size_t *'
I suspect this is due to the fact that one machine is 64-bit and the other is 32-bit, so that on my 64-bit machine size_t is aliased to a long int (%ld), whereas on my 32-bit machine size_t is aliased to another type.
Is there a format specifier specifically for size_t?