quote arguments in macros?

Matt Caswell matt at openssl.org
Tue Apr 7 14:14:38 UTC 2020


Yes - they should. Fixup PR welcome.

Matt

On 07/04/2020 12:12, Claus Assmann wrote:
> 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