Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 14: Fix incompatible pointer type in charsetstubs.c #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chusopr
Copy link

@chusopr chusopr commented Jan 10, 2024

The ml_iconv function in charsetstubs.c was passing a const char ** input buffer to iconv, but iconv expects a char **.

GCC 14 fails when passing that incompatible pointer type:

src/utils/lib/charsetstubs.c: In function ‘ml_iconv’:
src/utils/lib/charsetstubs.c:1207:23: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
 1207 |     return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
      |                       ^~~~~
      |                       |
      |                       const char **
In file included from src/utils/lib/charsetstubs.c:45:
/usr/include/iconv.h:49:54: note: expected ‘char ** restrict’ but argument is of type ‘const char **’
   49 | extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
      |                                    ~~~~~~~~~~~~~~~~~~^~~~~~~

Downstream bug: https://bugs.gentoo.org/921257

The ml_iconv function in charsetstubs.c was passing a const char ** input buffer to iconv, but iconv expects it to be a char **.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant