Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Kinichiro_I_
Beginner
242 Views

error assertion failed with Intel C++ Compiler 17.0

Hello,

I had this compilation error with Intel C++ Compiler 17.0 and Visual Studio 2015.

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>
1>      return (buf);

Source code is like this,

uint8_t *
tls_load_file(const char *name, size_t *len, char *password)
{
...
	char *data, *buf = NULL;
...
	return (buf);

This function is defined as returning (uint8_t *), but it returns (char *).

If I cast 'buf' by (uint8_t *), compilation error is resolved.
I think this could be a warning, though, should not be treated as an error.

Is this a compiler bug, or not ?

source code is here.
https://github.com/libressl-portable/openbsd/blob/master/src/lib/libtls/tls_util.c

and related report is here.
https://github.com/libressl-portable/portable/issues/209#issuecomment-249587024

Best regards,

0 Kudos
1 Reply
Judith_W_Intel
Employee
242 Views

 

I was able to create a reproducer. You must be using the /W4 option which issues remarks in additions to warnings.

!% cat t.c

typedef unsigned char uint8_t;

uint8_t *
tls_load_file()
{
    char *data, *buf = 0;
    return (buf);
}


!% icl -c /W4 t.c
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0 Beta Build x
Built Sep  7 2016 14:15:38 by jward4 on JWARD4-DESK1 in D:/workspaces/17_0cfe/dev
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

t.c
t.c(8): internal error: assertion failed: construct_message: not all fill-ins used (shared/cfe/edgcpfe/error.c, line 3586)

      return (buf);
             ^

compilation aborted for t.c (code 4)
!%

It is asserting while trying to print this remark:

t.c(8): remark #120: return value type does not match the function type
      return (buf);

I have submitted this into our internal bugs tracking database as DPD200414864.

thanks for reporting this.

As a workaround you can either:

(1) Fix the conversion with a cast (as you noticed).

(2) Suppress this remark with the command line option /Qdiag-disable:120.

We will fix this ASAP. Thanks for letting us know.

Judy

Reply