Warnings: pointer size vs. integer size
lfinsto at gwdg.de
lfinsto at gwdg.de
Thu Dec 3 16:22:59 CET 2009
Hello,
I'm not sure if this will be of any use to you, but I'm sending it in
case it is.
In order to get rid of this warning:
ex-client1.c: In function main:
ex-client1.c:81: warning: cast to pointer from integer of different size
mv -f .deps/ex-client1.Tpo .deps/ex-client1.Po
I've made the following changes in `gnutls/configure.ac' and
`gnutls/doc/examples/ex-client1.c', which I've attached:
In `configure.ac':
#### Added. LDF 2009.12.03.
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long int])
AC_CHECK_SIZEOF([void*])
#### End of added code. LDF 2009.12.03.
In `gnutls/doc/examples/ex-client1.c':
Before `main':
/* Added. LDF 2009.12.03. */
#if (SIZEOF_VOIDP == SIZEOF_INT)
#define PTR_SIZE_INT
#undef PTR_SIZE_LONG
#undef PTR_SIZE_UNDEFINED
#elif (SIZEOF_VOIDP == SIZEOF_LONG_INT)
#define PTR_SIZE_LONG
#undef PTR_SIZE_INT
#undef PTR_SIZE_UNDEFINED
#else
#define PTR_SIZE_UNDEFINED
#undef PTR_SIZE_INT
#undef PTR_SIZE_LONG
#endif
/* End of added code. LDF 2009.12.03. */
I would have liked `configure' to write this to `config.h', but
I don't know how to get it to do it and I don't have time at the
moment to search through the manual to try to find out.
In `main':
/* Added conditionally compiled code. LDF 2009.12.03. */
#ifdef PTR_SIZE_LONG
printf("PTR_SIZE_LONG is defined.\n"); /* Debugging output */
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) ((long) sd));
#else
printf("PTR_SIZE_LONG is undefined.\n"); /* Debugging output */
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
#endif
/* End of added conditionally compiled code. LDF 2009.12.03. */
There are lots of other places where similar warnings occur.
(I was happy with 32 bit addresses, myself.)
Laurence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.ac
Type: application/octet-stream
Size: 9923 bytes
Desc: not available
URL: </pipermail/attachments/20091203/77715668/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex-client1.c
Type: text/x-csrc
Size: 2801 bytes
Desc: not available
URL: </pipermail/attachments/20091203/77715668/attachment.c>
More information about the Gnutls-devel
mailing list