[openssl-project] OS/X builds failing
Viktor Dukhovni
openssl-users at dukhovni.org
Fri Feb 9 16:03:40 UTC 2018
> On Feb 9, 2018, at 5:15 AM, Matt Caswell <matt at openssl.org> wrote:
>
> The new travis OS/X builds are failing with this:
>
> -MT apps/enc.o -c -o apps/enc.o apps/enc.c
> apps/enc.c:567:54: error: format specifies type 'uintmax_t' (aka
> 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned
> long long') [-Werror,-Wformat]
> BIO_printf(bio_err, "bytes read : %8ju\n", BIO_number_read(in));
> ~~~~ ^~~~~~~~~~~~~~~~~~~
> %8llu
> apps/enc.c:568:54: error: format specifies type 'uintmax_t' (aka
> 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned
> long long') [-Werror,-Wformat]
> BIO_printf(bio_err, "bytes written: %8ju\n",
> BIO_number_written(out));
> ~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
> %8llu
> 2 errors generated.
>
>
> The thing is though this is *our* BIO_printf, and we do seem to expect a
> uint64_t for a "%ju". So I'm not sure how to fix that.
The obvious and correct fix is to cast the output of BIO_number_read() and
BIO_number_written() to uintmax_t. And we should expect uintmax_t with %j,
even in our BIO_printf(). It happens to be 64-bit on all the platforms we
support perhaps (any Crays?), but that's just a coincidence.
--
Viktor.
More information about the openssl-project
mailing list