1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Debian bug 464384: fix cast warning in ssl_connect

There are warnings about casts in the Debian amd64 build logs:
http://buildd.debian.org/fetch.cgi?&pkg=elinks&ver=0.11.3-2&arch=amd64&stamp=1200348983&file=log

	[CC]   src/intl/gettext/dcigettext.o
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c: In function '_nl_find_msg':
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:745: warning: cast from pointer to integer of different size
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:746: warning: cast from pointer to integer of different size
...
	[CC]   src/network/ssl/socket.o
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c: In function 'ssl_connect':
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c:219: warning: cast to pointer from integer of different size

The warnings in _nl_find_msg were caused by alignof, which I already
fixed.  This commit ought to fix the gnutls_transport_set_ptr call in
ssl_connect.  This warning did not yet happen in bug 464384 because
the others broke the build before it got that far.
This commit is contained in:
Kalle Olavi Niemitalo 2008-02-09 15:07:04 +02:00 committed by Kalle Olavi Niemitalo
parent d529a1f24d
commit 6555359f8e
2 changed files with 9 additions and 2 deletions

2
NEWS
View File

@ -129,7 +129,7 @@ Miscellaneous:
Build system and compile-time errors (ignore if you don't build ELinks):
* serious Debian bug 464384: fix cast warning in alignof
* serious Debian bug 464384: fix cast warnings in alignof and ssl_connect
* bug 725: fix version checking for Ruby in 'configure'
* enhancement: if make -k was used and a sub-Make fails, build the
rest before propagating

View File

@ -154,8 +154,15 @@ ssl_connect(struct socket *socket)
}
#elif defined(CONFIG_GNUTLS)
/* GnuTLS uses function pointers for network I/O. The default
* functions take a file descriptor, but it must be passed in
* as a pointer. GnuTLS uses the GNUTLS_INT_TO_POINTER and
* GNUTLS_POINTER_TO_INT macros for these conversions, but
* those are unfortunately not in any public header. So
* ELinks must just cast the pointer the best it can and hope
* that the conversions match. */
gnutls_transport_set_ptr(*((ssl_t *) socket->ssl),
(gnutls_transport_ptr) socket->fd);
(gnutls_transport_ptr) (longptr_T) socket->fd);
/* TODO: Some certificates fuss. --pasky */
#endif