Hey,

No, it is not in svn yet. I am not sure that this is the correct way to solve the problem. AFAIK there is a problem with the API of gnutls and the warning we obtain occurs in all codes using this function. Further research on the web indicate that the correct (but ugly) way of suppressing the warning seems to be

- gnutls_transport_set_ptr(cl->session, (gnutls_transport_ptr_t)cl->fd);
+ gnutls_transport_set_ptr(cl->session,(gnutls_transport_ptr_t)(long) cl->fd);

Curiously, they used void type for passing an int argument, that's why we have the warning on 64 bits platforms. So either we let the code as it is (since the warning is due to a bad API) or we apply the attached patch which fixes the warning without changing the logic of the code.

Mathieu

Hey

On Thu, 10 Feb 2011, [email protected] wrote:

Hello,

I have this warning when I compile ecore

ecore_con_ssl.c: In function ÿÿ_ecore_con_ssl_server_init_gnutlsÿÿ:
ecore_con_ssl.c:552:48: warning: cast to pointer from integer of
different size
ecore_con_ssl.c: In function ÿÿ_ecore_con_ssl_client_init_gnutlsÿÿ:
ecore_con_ssl.c:853:47: warning: cast to pointer from integer of
different size

has the patch below been applied ?

Vincent

the guilty lines are

Index: ecore_con_ssl.c
===================================================================
--- ecore_con_ssl.c (revision 56898)
+++ ecore_con_ssl.c (working copy)
@@ -549,7 +549,7 @@
SSL_ERROR_CHECK_GOTO_ERROR(ret = gnutls_credentials_set(svr->session,
GNUTLS_CRD_ANON, svr->anoncred_c));

gnutls_dh_set_prime_bits(svr->session, 512);
- gnutls_transport_set_ptr(svr->session,
(gnutls_transport_ptr_t)svr->fd);
+ gnutls_transport_set_ptr(svr->session,
(gnutls_transport_ptr_t)&svr->fd);
svr->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;

case ECORE_CON_SSL_STATE_HANDSHAKING:
@@ -850,7 +850,7 @@
gnutls_certificate_server_set_request(cl->session, GNUTLS_CERT_REQUEST);

gnutls_dh_set_prime_bits(cl->session, 2048);
- gnutls_transport_set_ptr(cl->session, (gnutls_transport_ptr_t)cl->fd);
+ gnutls_transport_set_ptr(cl->session, (gnutls_transport_ptr_t)&cl->fd);
cl->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;

case ECORE_CON_SSL_STATE_HANDSHAKING:

and the problem comes from the fact that fd variable is an int while
the function requires a pointer. The patch is straightforward but I do
not know the role of the fd variable. If one of you could indicate me
its role here, I would more than happy to send the patch.

Cheers

Mathieu

------------------------------------------------------------------------------

The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel



fix a compilation warning in ecore_ssl.c


 ecore_con_ssl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: src/lib/ecore_con/ecore_con_ssl.c
===================================================================
--- src/lib/ecore_con/ecore_con_ssl.c   (revision 57732)
+++ src/lib/ecore_con/ecore_con_ssl.c   (working copy)
@@ -547,7 +547,7 @@
           SSL_ERROR_CHECK_GOTO_ERROR(ret = 
gnutls_credentials_set(svr->session, GNUTLS_CRD_ANON, svr->anoncred_c));
 
         gnutls_dh_set_prime_bits(svr->session, 512);
-        gnutls_transport_set_ptr(svr->session, 
(gnutls_transport_ptr_t)svr->fd);
+        gnutls_transport_set_ptr(svr->session, 
(gnutls_transport_ptr_t)(long)svr->fd);
         svr->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;
 
       case ECORE_CON_SSL_STATE_HANDSHAKING:
@@ -848,7 +848,7 @@
         gnutls_certificate_server_set_request(cl->session, 
GNUTLS_CERT_REQUEST);
 
         gnutls_dh_set_prime_bits(cl->session, 2048);
-        gnutls_transport_set_ptr(cl->session, (gnutls_transport_ptr_t)cl->fd);
+        gnutls_transport_set_ptr(cl->session, 
(gnutls_transport_ptr_t)(long)cl->fd);
         cl->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;
 
       case ECORE_CON_SSL_STATE_HANDSHAKING:
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to