[Mingw-w64-public] Mass rebuild report for April 27 2013
JonY
jon_y at users.sourceforge.net
Sat Apr 27 16:11:59 UTC 2013
On 4/27/2013 22:40, Dongsheng Song wrote:
> Here is the root cause.
>
> gettext use C linkage at gettext-runtime/libasprintf/vasprintf.h:
>
> #ifdef __cplusplus
> extern "C" {
> #endif
>
> /* 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)));
>
__printf__ is not the same as gnu_printf, it is a mess on the gettext side.
>
> On stdio.h, mingw-w64 use C++ linkage:
>
> /* There seems to be a bug about builtins and static overrides of them
> in g++. So we need to do here some trickery. */
There aren't any asprintf builtins, so probably a good idea to move it.
> #ifdef __cplusplus
> extern "C++" {
> #endif
> ...
> #ifdef _GNU_SOURCE
> __mingw_ovr
> __attribute__ ((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2)))
> int asprintf(char **__ret, const char *__format, ...)
> {
> register int __retval;
> __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
> __retval = __mingw_vasprintf( __ret, __format, __local_argv );
> __builtin_va_end( __local_argv );
> return __retval;
> }
>
> __mingw_ovr
> __attribute__ ((__format__ (gnu_printf, 2, 0))) __attribute__((nonnull (1,2)))
> int vasprintf(char **__ret, const char *__format, __builtin_va_list
> __local_argv)
> {
> return __mingw_vasprintf( __ret, __format, __local_argv );
> }
> #endif /* _GNU_SOURCE */
> ...
>
> I think mingw-w64 should not use C++ linkage for these C functions
> when use C++ compiler.
Alternatively, don't declare it in gettext.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 663 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/mingw/attachments/20130428/622f78a6/attachment-0001.sig>
More information about the mingw
mailing list