From 500289eff11712010d492af19860c27303619121 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <[email protected]>
Date: Sat, 15 Jul 2023 11:04:46 +0530
Subject: [PATCH] crt: Add noreturn attribute with _amsg_exit
This fixes the following compiler warning
ucrtbase_compat.c:105:34: warning: function `_amsg_exit' could be
declared with attribute `noreturn' [-Wmissing-noreturn]
void __cdecl _amsg_exit(int ret) {
^
Signed-off-by: Biswapriyo Nath <[email protected]>
---
mingw-w64-crt/crt/ucrtbase_compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-crt/crt/ucrtbase_compat.c
b/mingw-w64-crt/crt/ucrtbase_compat.c
index 33eeaff..0143dd9 100644
--- a/mingw-w64-crt/crt/ucrtbase_compat.c
+++ b/mingw-w64-crt/crt/ucrtbase_compat.c
@@ -35,7 +35,7 @@
// to get rid of the _CRTIMP in headers).
int __cdecl __getmainargs(int * _Argc, char *** _Argv, char ***_Env, int
_DoWildCard, _startupinfo *_StartInfo);
int __cdecl __wgetmainargs(int * _Argc, wchar_t *** _Argv, wchar_t ***_Env,
int _DoWildCard, _startupinfo *_StartInfo);
-void __cdecl _amsg_exit(int ret);
+void __cdecl __attribute__((__noreturn__)) _amsg_exit(int ret);
unsigned int __cdecl _get_output_format(void);
int __cdecl __ms_fwprintf(FILE *, const wchar_t *, ...);
@@ -102,7 +102,7 @@ int __cdecl at_quick_exit(void (__cdecl *func)(void))
int __cdecl (*__MINGW_IMP_SYMBOL(at_quick_exit))(void (__cdecl *)(void)) =
at_quick_exit;
-void __cdecl _amsg_exit(int ret) {
+void __cdecl __attribute__((__noreturn__)) _amsg_exit(int ret) {
fprintf(stderr, "runtime error %d\n", ret);
_exit(255);
}
--
2.41.0
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public