[Help-gnutls] Re: gnutls 2.3.4 doesn't copile using MinGW
Simon Josefsson
simon at josefsson.org
Wed Apr 23 01:06:25 CEST 2008
Massimo Gaspari <massimo.gaspari at alice.it> writes:
>>> 1) a warning realted to vasprintf (an old friend , isn't it?)
>>>
>>> gnutls_str.c: In function '_gnutls_string_append_printf':
>>> gnutls_str.c:238: warning: implicit declaration of function 'vasprintf'
>>>
>>
>> This seems strange. The gnutls_str.c file includes gnutls_int.h which
>> includes defines.h which includes stdio.h. Gnulib will create stdio.h
>> if mingw doesn't provide one with suitable vasprintf declaration. Can
>> you search for vasprintf in lgl/stdio.h and show me how the block looks?
>>
>>
> Here it is.
>
> #if 1
> # if 0
> # define asprintf rpl_asprintf
> # define vasprintf rpl_vasprintf
> # endif
> # if 0 || !1
> /* Write formatted output to a string dynamically allocated with malloc().
> If the memory allocation succeeds, store the address of the string in
> *RESULT and return the number of resulting bytes, excluding the
> trailing
> NUL. Upon memory allocation error, or some other error, return -1. */
> extern int asprintf (char **result, const char *format, ...)
> __attribute__ ((__format__ (__printf__, 2, 3)));
> extern int vasprintf (char **result, const char *format, va_list args)
> __attribute__ ((__format__ (__printf__, 2, 0)));
> # endif
> #endif
>
> The stdio.in.h says
>
> #if @GNULIB_VASPRINTF@
> # if @REPLACE_VASPRINTF@
> # define asprintf rpl_asprintf
> # define vasprintf rpl_vasprintf
> # endif
> # if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
> /* Write formatted output to a string dynamically allocated with malloc().
> If the memory allocation succeeds, store the address of the string in
> *RESULT and return the number of resulting bytes, excluding the
> trailing
> NUL. Upon memory allocation error, or some other error, return -1. */
> extern int asprintf (char **result, const char *format, ...)
> __attribute__ ((__format__ (__printf__, 2, 3)));
> extern int vasprintf (char **result, const char *format, va_list args)
> __attribute__ ((__format__ (__printf__, 2, 0)));
> # endif
> #endif
>
> And the compiler is right.
This suggests ./configure thought that your system had vasprintf but it
was not declared anywhere. This would be a consequence from using
libgcrypt < 1.4.1rc1. Earlier libgcrypt versions contained an unused
implementation of vasprintf which was exported to the static library. I
added a cludge in GnuTLS to detect and use that vasprintf, but I think
it is the wrong thing to do -- it doesn't handle the function prototype.
I have reverted the workaround. Instead, you'll need to use libgcrypt
1.4.1rc1 to avoid the duplicate vasprintf symbol problem. Please try
tomorrow's snapshot.
>>> ex-serv-export.c:182: warning: passing argument 4 of 'setsockopt' from
>>> incompatible pointer type
>>>
>>
>> According to POSIX it should be 'const void*':
>>
>> http://www.opengroup.org/onlinepubs/009695399/functions/setsockopt.html
>>
>> Gnulib should probably needs to add a wrapper for this as well.
>>
>
> Yes but Windows is not POSIX compliant.
I have added a fix in gnulib for this now, so the warning should be
gone.
>>> 4) several
>>>
>>> libtool: link: warning: `-no-install' is ignored for i686-pc-mingw32
>>> libtool: link: warning: assuming `-no-fast-install' instead
>>>
>>> We can ignore those..
>>>
>>
>> I think those are harmless libtool problems, but I'm not sure. If you
>> (or anyone) wants to track it down and investigate it, please do.
> I'll try to look at that.
Thanks,
Simon
More information about the Gnutls-help
mailing list