On Sat, Oct 1, 2016 at 7:12 PM, Ted Unangst <t...@tedunangst.com> wrote:

> Kinichiro Inoguchi wrote:
> > I would like to cast the return variable explicitly in tls_load_file().
> > This fix also avoiding Intel C++ compiler "assertion failed" described
> here.
> > https://github.com/libressl-portable/portable/issues/209#
> issuecomment-249587024
>
> This is a compiler bug? The code doesn't change, and there's no bug in the
> library that I see.
>

​If the compiler is implying that the code is incorrect, it has a funny way
of saying it. This looks not-dissimilar to a gcc ICE:

​
 1>C:\libressl-2.5.0\tls\tls_util.c(157): error : assertion failed:
construct_message: not all fill-ins used (shared/cfe/edgcpfe/error.c, line
3586)
1>

​Why not just make the variable type match the return type to begin with?

​--- a/src/lib/libtls/tls_util.c
+++ b/src/lib/libtls/tls_util.c
@@ -105,7 +105,8 @@ tls_load_file(const char *name, size_t *len, char
*password)
        FILE *fp;
        EVP_PKEY *key = NULL;
        BIO *bio = NULL;
-       char *data, *buf = NULL;
+       char *data;
+       uint8_t *buf = NULL;
        struct stat st;
        size_t size;
        int fd = -1;

Reply via email to