Browse Source

libc: cast free() argument to void * in wchar.c

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>
Yuriy Kolerov 10 months ago
parent
commit
d1c744fbde
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/misc/wchar/wchar.c

+ 1 - 1
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;
 }