You are right: __builtin_clzll() and it is not portable... and I forgot sizeof returns the number of bytes, so I need to multiply sizeof( size_t ) by 8 as well...
There is a small confusion with the use of CHAR_BIT... this is the number of bits of char type. A byte is defined as 8 bits long (since 1960's I believe).
Thanks, anyway, for the correction!