Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW: Use correct format specifier #54804

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/julia.h
topolarity marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2433,19 +2433,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;
Expand Down
2 changes: 1 addition & 1 deletion src/signals-win.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/support/utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#ifdef _OS_WINDOWS_
#include <malloc.h>
#define snprintf _snprintf
#else
#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <alloca.h>
Expand Down