[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnutls-dev] size_t, int and 64 bit machines

From: Simon Josefsson
Subject: Re: [gnutls-dev] size_t, int and 64 bit machines
Date: Wed, 21 Mar 2007 14:42:57 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux)

Deanna Phillips <address@hidden> writes:

> Hello,
> I noticed some size_t and int mixing that causes the
> set_pkcs12_cred test to fail on OpenBSD/sparc64.

Hi!  Thanks for the report.

> Here, sizeof int is 4, and sizeof size_t is 8.  Several warnings
> such as this are produced:
> gnutls_x509.c:1897: warning: passing arg 2 of `read_binary_file' from 
> incompatible pointer type
> The simple fix for that particular test was -
>    typedef struct
>    {
>      unsigned char *data;
> -    unsigned int size;
> +    size_t size;
>    } gnutls_datum_t;

I am aware of this one, but the problem is: it is part of gnutls.h and
thus part of the external API.  This is really problematic to change,
since it won't be backwards compatible.

However, can we get away by considering that GnuTLS doesn't work at
all on platforms with 8-byte size_t and just make the change?  We have
already some supported 64-bit platforms, e.g. amd64 and ia64, but do
they have 8-byte size_t?  I doubt this is a reasonable way forward...

Another alternative is to create a new type 'gnutls_buffer_t' with the
proper types, and create new APIs for all existing APIs that use the
type.  Which is rather difficult.

A further alternative is to combine the last solution with library
versioning, to avoid renaming functions, although this is not very
portable as far as I know (?).

> Also included here is a patch that allows the pcks1-padding test
> to run on systems that pad wc(1) output with spaces, and another
> to include netinet/in.h for struct sockaddr_in in the anonself
> test.

I have installed this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]