[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Info-mtools] [PATCH] Fix invalid use of iconv_t*
From: |
Alain Knaff |
Subject: |
Re: [Info-mtools] [PATCH] Fix invalid use of iconv_t* |
Date: |
Fri, 16 Apr 2021 23:45:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 |
Hi,
On 14/04/2021 18:02, Alistair Delva via Info-mtools wrote:
> 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.
Thanks for the heads up. This is now fixed in 4.0.27
Regards,
Alain
> ---
> 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;
>