[openssl-dev] ssl_sess.c : compilation error

Kurt Roeckx kurt at roeckx.be
Sat Jun 6 21:51:28 UTC 2015


On Sun, Jun 07, 2015 at 12:17:06AM +0300, Zvi Vered wrote:
> Dear Members,
> 
> In the file openssl-1.0.1g\ssl\ssl_sess.c contains the following code:
> 
> int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(SSL *ssl, SSL_SESSION *sess)
>     {
>     return ctx->new_session_cb;
>     }
> 
> The return value of this routine is a "pointer to function".
> But the code : 
> 
> ctx->new_session_cb
> 
> uses a parameter of the return value. How this is possible ?

The function without return type is:
SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)

The return value is a function that looks like:
int new_session_cb(struct ssl_st *ssl, SSL_SESSION *sess)

I hope that explains it.

> I'm trying to compile this code using diab compiler for vxworks6.3 and 
> I have a syntax error.
> 
> Using this compiler for vxWorks 6.9 (newer compiler) gives no syntax 
> error.
> 
> Is there another way to write this code ?

You can make typedefs that might make it easier for you to
understand it, but I would hope that makes no differences for a
compiler.

You could also try to just remove that function in case you don't
need it in your application.


Kurt



More information about the openssl-dev mailing list