[openssl-dev] [openssl.org #4471] 1.1.0-pre4 safestack.h compilation errors with -Wcast-qual

Brian Wellington via RT rt at openssl.org
Mon May 16 18:32:13 UTC 2016


This is fixed, but there are similar problems that still exist, for example:

—
#include <openssl/err.h>
#include <openssl/ssl.h>

int
main(int argc, char **argv) {
    return 0;
}
—

clang -Wcast-qual -o foo.o foo.c -I openssl-SNAP-20160516/include/
In file included from foo.c:1:
In file included from openssl-SNAP-20160516/include/openssl/err.h:123:
openssl-SNAP-20160516/include/openssl/lhash.h:265:1: warning: cast from 'const
      struct lhash_st_OPENSSL_STRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
DEFINE_LHASH_OF(OPENSSL_STRING);
^
openssl-SNAP-20160516/include/openssl/lhash.h:217:37: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_stats_bio((_LHASH *)lh, out); \
                                    ^
openssl-SNAP-20160516/include/openssl/lhash.h:265:1: warning: cast from 'const
      struct lhash_st_OPENSSL_STRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:221:43: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_usage_stats_bio((_LHASH *)lh, out); \
                                          ^
openssl-SNAP-20160516/include/openssl/lhash.h:265:1: warning: cast from 'const
      struct lhash_st_OPENSSL_STRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:225:32: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_stats_bio((_LHASH *)lh, out); \
                               ^
openssl-SNAP-20160516/include/openssl/lhash.h:266:1: warning: cast from 'const
      struct lhash_st_OPENSSL_CSTRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
DEFINE_LHASH_OF(OPENSSL_CSTRING);
^
openssl-SNAP-20160516/include/openssl/lhash.h:217:37: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_stats_bio((_LHASH *)lh, out); \
                                    ^
openssl-SNAP-20160516/include/openssl/lhash.h:266:1: warning: cast from 'const
      struct lhash_st_OPENSSL_CSTRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:221:43: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_usage_stats_bio((_LHASH *)lh, out); \
                                          ^
openssl-SNAP-20160516/include/openssl/lhash.h:266:1: warning: cast from 'const
      struct lhash_st_OPENSSL_CSTRING *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:225:32: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_stats_bio((_LHASH *)lh, out); \
                               ^
In file included from foo.c:1:
openssl-SNAP-20160516/include/openssl/err.h:321:1: warning: cast from 'const
      struct lhash_st_ERR_STRING_DATA *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
DEFINE_LHASH_OF(ERR_STRING_DATA);
^
openssl-SNAP-20160516/include/openssl/lhash.h:217:37: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_stats_bio((_LHASH *)lh, out); \
                                    ^
In file included from foo.c:1:
openssl-SNAP-20160516/include/openssl/err.h:321:1: warning: cast from 'const
      struct lhash_st_ERR_STRING_DATA *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:221:43: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_node_usage_stats_bio((_LHASH *)lh, out); \
                                          ^
In file included from foo.c:1:
openssl-SNAP-20160516/include/openssl/err.h:321:1: warning: cast from 'const
      struct lhash_st_ERR_STRING_DATA *' to 'struct lhash_st *' drops const
      qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/lhash.h:225:32: note: expanded from macro
      'DEFINE_LHASH_OF'
        lh_stats_bio((_LHASH *)lh, out); \
                               ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
DEFINE_STACK_OF_CONST(SSL_CIPHER)
^
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:123:58: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return (t2 *)sk_delete_ptr((_STACK *)sk, (void *)ptr); \
                                                         ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:127:46: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return sk_push((_STACK *)sk, (void *)ptr); \
                                             ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:131:49: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return sk_unshift((_STACK *)sk, (void *)ptr); \
                                                ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:147:48: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return sk_insert((_STACK *)sk, (void *)ptr, idx); \
                                               ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:151:56: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return (t2 *)sk_set((_STACK *)sk, idx, (void *)ptr); \
                                                       ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:155:46: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return sk_find((_STACK *)sk, (void *)ptr); \
                                             ^
In file included from foo.c:2:
openssl-SNAP-20160516/include/openssl/ssl.h:918:1: warning: cast from 'const
      struct ssl_cipher_st *' to 'void *' drops const qualifier [-Wcast-qual]
openssl-SNAP-20160516/include/openssl/safestack.h:188:35: note: expanded from
      macro 'DEFINE_STACK_OF_CONST'
# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
                                  ^
openssl-SNAP-20160516/include/openssl/safestack.h:159:49: note: expanded from
      macro 'SKM_DEFINE_STACK_OF'
        return sk_find_ex((_STACK *)sk, (void *)ptr); \
                                                ^
16 warnings generated.
wavelet:~/Work/Software: 


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4471
Please log in as guest with password guest if prompted



More information about the openssl-dev mailing list