when to size_t for representing length instead of intâ?

From: none
Date: Thu Oct 13 2016 - 18:20:19 EST


Hello,

I wanted to known the rules in coding guidelines concerning the use of size_t.
It seems the signed int type is used most of the time for representing string sizes, including in some parts written by Linus in /lib.
Theyâre can buffer overflows attack if ssize_t if larger than sizeof(int) (though I agree this isnât the only way, but at least itÂs less error prone).

So is it guaranteed for all current and future cpu architectures the Linux kernel support that ssize_t will always be equal to sizeof(int)â?

regards,