From 549d9e2f2ac3349b474127b8165a689ec7134e39 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath <[email protected]> Date: Mon, 23 Jan 2023 18:52:01 +0530 Subject: [PATCH] crt: Fix builtin declaration mismatch warning with ssp functions
This fixes the following warnings with gcc warning: mismatch in argument 2 type of built-in function '__memmove_chk'; expected 'const void *' [-Wbuiltin-declaration-mismatch] warning: mismatch in argument 2 type of built-in function '__memcpy_chk'; expected 'const void *' [-Wbuiltin-declaration-mismatch] warning: mismatch in argument 2 type of built-in function '__mempcpy_chk'; expected 'const void *' [-Wbuiltin-declaration-mismatch] Signed-off-by: Biswapriyo Nath <[email protected]> --- mingw-w64-crt/ssp/memcpy_chk.c | 4 ++-- mingw-w64-crt/ssp/memmove_chk.c | 4 ++-- mingw-w64-crt/ssp/mempcpy_chk.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mingw-w64-crt/ssp/memcpy_chk.c b/mingw-w64-crt/ssp/memcpy_chk.c index 3dee104..8ff41ca 100644 --- a/mingw-w64-crt/ssp/memcpy_chk.c +++ b/mingw-w64-crt/ssp/memcpy_chk.c @@ -8,9 +8,9 @@ void __cdecl __chk_fail(void) __attribute__((__noreturn__)); -void *__cdecl __memcpy_chk(void *dst, void *src, size_t n, size_t bufsize); +void *__cdecl __memcpy_chk(void *dst, const void *src, size_t n, size_t bufsize); -void *__cdecl __memcpy_chk(void *dst, void *src, size_t n, size_t bufsize) +void *__cdecl __memcpy_chk(void *dst, const void *src, size_t n, size_t bufsize) { if (n > bufsize) __chk_fail(); diff --git a/mingw-w64-crt/ssp/memmove_chk.c b/mingw-w64-crt/ssp/memmove_chk.c index 9d29fef..888c702 100644 --- a/mingw-w64-crt/ssp/memmove_chk.c +++ b/mingw-w64-crt/ssp/memmove_chk.c @@ -8,9 +8,9 @@ void __cdecl __chk_fail(void) __attribute__((__noreturn__)); -void *__cdecl __memmove_chk(void *dst, void *src, size_t n, size_t bufsize); +void *__cdecl __memmove_chk(void *dst, const void *src, size_t n, size_t bufsize); -void *__cdecl __memmove_chk(void *dst, void *src, size_t n, size_t bufsize) +void *__cdecl __memmove_chk(void *dst, const void *src, size_t n, size_t bufsize) { if (n > bufsize) __chk_fail(); diff --git a/mingw-w64-crt/ssp/mempcpy_chk.c b/mingw-w64-crt/ssp/mempcpy_chk.c index b8fc6db..d04f9a1 100644 --- a/mingw-w64-crt/ssp/mempcpy_chk.c +++ b/mingw-w64-crt/ssp/mempcpy_chk.c @@ -9,9 +9,9 @@ void __cdecl __chk_fail(void) __attribute__((__noreturn__)); -void *__cdecl __mempcpy_chk(void *dst, void *src, size_t n, size_t bufsize); +void *__cdecl __mempcpy_chk(void *dst, const void *src, size_t n, size_t bufsize); -void *__cdecl __mempcpy_chk(void *dst, void *src, size_t n, size_t bufsize) +void *__cdecl __mempcpy_chk(void *dst, const void *src, size_t n, size_t bufsize) { if (n > bufsize) __chk_fail(); -- 2.39.1
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
