quote arguments in macros?

Claus Assmann ca+ssl-users at esmtp.org
Tue Apr 7 11:12:53 UTC 2020


I just got a compiler warning while modifying some code:

SSL_set_tlsext_host_name(ssl, sni)
->

#define IS_EMPTY(s)  (NULL == (s) || '\0' == *(s))
SSL_set_tlsext_host_name(ssl, !IS_EMPTY(sni) ? sni : other)

warning: cast to 'char *' from smaller integer type 'int'

      'SSL_set_tlsext_host_name'
SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
                                                                          ^^^^

Shouldn't the arguments in those macros be quoted, e.g.,
SSL_ctrl((s),SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)(name))
?



More information about the openssl-users mailing list