diff mbox series

[uclibc-ng-devel] libc: cast free() argument to void * in wchar.c

Message ID 20240614171534.2172-1-kolerov93@gmail.com
State Accepted
Headers show
Series [uclibc-ng-devel] libc: cast free() argument to void * in wchar.c | expand

Commit Message

kolerov93@gmail.com June 14, 2024, 5:15 p.m. UTC
From: Yuriy Kolerov <ykolerov@synopsys.com>

iconv_close() accepts iconv_t type (which is void *) and passes
it to free() which accepts void *. However, GCC 14 raises a
-Wint-conversion warning if it is not casted to void * because
GCC cannot unwind typedef of iconv_t.

Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
---
 libc/misc/wchar/wchar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 2714d47d7..782b67f93 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -1298,7 +1298,7 @@  iconv_t weak_function iconv_open(const char *tocode, const char *fromcode)
 
 int weak_function iconv_close(iconv_t cd)
 {
-	free(cd);
+	free((void *) cd);
 
 	return 0;
 }