On 10/11/2016 02:18 AM, Markus Armbruster wrote:
>> +#define SIZE_MAX ((sizeof(char)) * -1)
>
> All right, let's see how this works.
>
>
> Cute, but what's wrong with straightforward
>
> #define SIZE_MAX ((size_t)-1)
I was trying to make the macro usable even in situations where 'size_t'
Eric Blake writes:
> C99 requires SIZE_MAX to be declared with the same type as the
> integral promotion of size_t, but OSX mistakenly defines it as
> an 'unsigned long long' expression even though size_t is only
> 'unsigned long'. Rather than futzing around with whether size_t
> is 32- or 64-bi
C99 requires SIZE_MAX to be declared with the same type as the
integral promotion of size_t, but OSX mistakenly defines it as
an 'unsigned long long' expression even though size_t is only
'unsigned long'. Rather than futzing around with whether size_t
is 32- or 64-bits wide (which would be needed