> On Feb 9, 2018, at 11:23 AM, Richard Levitte <levi...@openssl.org> wrote:
> 
> From those errors, it looks to me like uintmax_t isn't 64-bit on that
> Mac OS/X machine, unless 'unsigned long' and 'unsigned long long' are
> the same.

No, the compiler is not telling you they're not actually the same, rather
it is telling you that their definitions are independent, and they *could*
be different, and so the code is not portable.

> (that error does surprise me, since uintmax_t is supposed to be the
> largest integer type possible, and yet, the error suggests that this
> isn't the case here)

See above.  Compiling the below on the latest MacOS/X:

$ cat size.c
#include <stdio.h>
#include <stdint.h>

int main(int argc, char **argv)
{
        printf("char = %zu\n", sizeof(unsigned char));
        printf("short = %zu\n", sizeof(unsigned short));
        printf("int = %zu\n", sizeof(unsigned int));
        printf("long = %zu\n", sizeof(unsigned long int));
        printf("long long = %zu\n", sizeof(unsigned long long int));

        printf("int8_t = %zu\n", sizeof(uint8_t));
        printf("int16_t = %zu\n", sizeof(uint16_t));
        printf("int32_t = %zu\n", sizeof(uint32_t));
        printf("int64_t = %zu\n", sizeof(uint64_t));
        printf("intmax_t = %zu\n", sizeof(uintmax_t));
        return 0;
}

shows that long, long long, int64_t and intmax_t are presently all the same:

$ ./size
char = 1
short = 2
int = 4
long = 8
long long = 8
int8_t = 1
int16_t = 2
int32_t = 4
int64_t = 8
intmax_t = 8

-- 
        Viktor.

_______________________________________________
openssl-project mailing list
openssl-project@openssl.org
https://mta.openssl.org/mailman/listinfo/openssl-project

Reply via email to