info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] [PATCH] Fix invalid use of iconv_t*


From: Alistair Delva
Subject: [Info-mtools] [PATCH] Fix invalid use of iconv_t*
Date: Wed, 14 Apr 2021 16:02:57 +0000

When building this file against glibc, no warnings are seen. However,
when building for an arm64 Android target (using the bionic glibc), the
following warning is seen:

external/mtools/charsetConv.c:119:7: error: incompatible pointer types
assigning to 'iconv_t *' (aka 'struct __iconv_t **') from 'iconv_t'
(aka 'struct __iconv_t *') [-Werror,-Wincompatible-pointer-types]
        from = iconv_open(wcharCp, dosCp);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~

The code looks wrong; it shouldn't be using iconv_t*, rather it should
use iconv_t, like the rest of the file. Fix it.
---
 charsetConv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/charsetConv.c b/charsetConv.c
index 8734be5..085d887 100644
--- a/charsetConv.c
+++ b/charsetConv.c
@@ -102,8 +102,8 @@ doscp_t *cp_open(int codepage)
 {
        char dosCp[17];
        doscp_t *ret;
-       iconv_t *from;
-       iconv_t *to;
+       iconv_t from;
+       iconv_t to;
 
        if(codepage == 0)
                codepage = mtools_default_codepage;
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]