compilation error with gnutls 2.12.10 a,d mingw-w64

Simon Josefsson simon at josefsson.org
Mon Oct 10 15:14:44 CEST 2011


Nikos Mavrogiannopoulos <nmav at gnutls.org> writes:

> On Mon, Oct 10, 2011 at 2:21 PM, Simon Josefsson <simon at josefsson.org> wrote:
>
>> So the proper type to use seems to be gnutls_openpgp_keyid_t instead of
>> uint8_t/unsigned char.  It is declared like this:
>> #define GNUTLS_OPENPGP_KEYID_SIZE 8
>>  typedef unsigned char gnutls_openpgp_keyid_t[GNUTLS_OPENPGP_KEYID_SIZE];
>
> This is wrong! gnutls_openpgp_keyid_t with the above typedef is just a
> pointer type meaning it has 4 bytes in 32-bit systems. I made the
> definition like that to make clear to the caller that 8-bytes should
> be allocated, but it seems this obscure typedef is confusing. It might
> be better to be replaced with a simple pointer type.

Heh, good point.  Lack of coffee.  So I think the proper solution then
really is to duplicate the typedef'ed definition like this:

  unsigned char keyid[GNUTLS_OPENPGP_KEYID_SIZE];

With the rationale that if the library doesn't use uint8_t for this
type, the tool shouldn't either...

Pushed.

/Simon




More information about the Gnutls-devel mailing list