x86_64-w64-mingw32 test FAIL t-scanf.c:1477: GNU MP assertion failed: ret == (-1)

Vincent Lefevre vincent at vinc17.net
Thu Apr 6 15:40:19 UTC 2017


On 2017-04-06 17:12:22 +0200, Niels Möller wrote:
> I don't really know how that magic works, but my guess guess is that
> it's per compilation unit, so "printf" in the source code will refer to
> one of two different functions depending on which magic preprocessor
> symbols were defined when stdio.h was parsed. (Which then might violate
> C standard rules on function pointer comparison...)

One can look at the preprocessor output. :-)

Without -D__USE_MINGW_ANSI_STDIO:

int __attribute__((__cdecl__)) printf(const char * __restrict__ _Format,...);

With -D__USE_MINGW_ANSI_STDIO:

static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__))
__attribute__((__format__ (gnu_printf, 1, 2))) __attribute__ ((__nonnull__ (1)))
int printf (const char *__format, ...)
{
  register int __retval;
  __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format );
  __retval = __mingw_vprintf( __format, __local_argv );
  __builtin_va_end( __local_argv );
  return __retval;
}

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list