diff --git a/src/julia.h b/src/julia.h index b29b5d9794457..a7c26977aa20b 100644 --- a/src/julia.h +++ b/src/julia.h @@ -2424,19 +2424,24 @@ typedef struct { } jl_uv_file_t; #ifdef __GNUC__ -#define _JL_FORMAT_ATTR(type, str, arg) \ - __attribute__((format(type, str, arg))) +# ifdef __MINGW32__ +#define _JL_FORMAT_ATTR(str, arg) \ + __attribute__((format(__MINGW_PRINTF_FORMAT, str, arg))) +# else +#define _JL_FORMAT_ATTR(str, arg) \ + __attribute__((format(printf, str, arg))) +# endif #else -#define _JL_FORMAT_ATTR(type, str, arg) +#define _JL_FORMAT_ATTR(str, arg) #endif JL_DLLEXPORT void jl_uv_puts(struct uv_stream_s *stream, const char *str, size_t n); JL_DLLEXPORT int jl_printf(struct uv_stream_s *s, const char *format, ...) - _JL_FORMAT_ATTR(printf, 2, 3); + _JL_FORMAT_ATTR(2, 3); JL_DLLEXPORT int jl_vprintf(struct uv_stream_s *s, const char *format, va_list args) - _JL_FORMAT_ATTR(printf, 2, 0); + _JL_FORMAT_ATTR(2, 0); JL_DLLEXPORT void jl_safe_printf(const char *str, ...) JL_NOTSAFEPOINT - _JL_FORMAT_ATTR(printf, 1, 2); + _JL_FORMAT_ATTR(1, 2); extern JL_DLLEXPORT JL_STREAM *JL_STDIN; extern JL_DLLEXPORT JL_STREAM *JL_STDOUT; diff --git a/src/signals-win.c b/src/signals-win.c index aca20a45dd2ce..4c31df766f3f1 100644 --- a/src/signals-win.c +++ b/src/signals-win.c @@ -327,7 +327,7 @@ LONG WINAPI jl_exception_handler(struct _EXCEPTION_POINTERS *ExceptionInfo) default: jl_safe_printf("UNKNOWN"); break; } - jl_safe_printf(" at 0x%Ix -- ", (size_t)ExceptionInfo->ExceptionRecord->ExceptionAddress); + jl_safe_printf(" at 0x%zx -- ", (size_t)ExceptionInfo->ExceptionRecord->ExceptionAddress); jl_print_native_codeloc((uintptr_t)ExceptionInfo->ExceptionRecord->ExceptionAddress); jl_critical_error(0, 0, ExceptionInfo->ContextRecord, ct); diff --git a/src/support/utf8.c b/src/support/utf8.c index 02f541492b0f0..46a6515e9b753 100644 --- a/src/support/utf8.c +++ b/src/support/utf8.c @@ -27,7 +27,6 @@ #ifdef _OS_WINDOWS_ #include -#define snprintf _snprintf #else #if !defined(__FreeBSD__) && !defined(__OpenBSD__) #include