macaroni-os / macaroni-os/mark-issues

[text-kit] app-text/rman-3.2-r1 fails with new GCC 14.x

Open Beginner friendly
#693 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

>>> Emerging (20 of 552) app-text/rman-3.2-r1::text-kit
 * rman-3.2.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                       [ ok ]
>>> Unpacking source...
>>> Unpacking rman-3.2.tar.gz to /var/tmp/portage/app-text/rman-3.2-r1/work
>>> Source unpacked in /var/tmp/portage/app-text/rman-3.2-r1/work
>>> Preparing source in /var/tmp/portage/app-text/rman-3.2-r1/work/rman-3.2 ...
 * Applying rman-3.2-gentoo.diff ...                                                                                                                 [ ok ]
 * Applying rman-3.2-ldflags.patch ...                                                                                                               [ ok ]
 * Applying rman-3.2-format-security.patch ...                                                                                                       [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-text/rman-3.2-r1/work/rman-3.2 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-text/rman-3.2-r1/work/rman-3.2 ...
make -j12 -l12 CC=x86_64-pc-linux-gnu-gcc 'CFLAGS=-O2 -pipe -march=znver3 -mtune=znver3'
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -DNDEBUG -DVOLLIST='"1:2:3:4:5:6:7:8:9:o:l:n:p"' -DMANTITLEPRINTF='"%s(%s) manual page"' -DMANREFPRINTF='"%s.%s"' -DPOLYGLOTMANVERSION=\"3.2\" -O2 -pipe -march=znver3 -mtune=znver3 -o rman rman.c
rman.c: In function ‘casify’:
rman.c:364:99: error: passing argument 5 of ‘bsearch’ from incompatible pointer type [-Wincompatible-pointer-types]
  364 |                         exp = (char **)bsearch(&p, lcexceptions, lcexceptionslen, sizeof(char *), lcexceptionscmp);
      |                                                                                                   ^~~~~~~~~~~~~~~
      |                                                                                                   |
      |                                                                                                   int (*)(const char **, const char **)
In file included from /usr/include/stdlib.h:965,
                 from rman.c:24:
/usr/include/bits/stdlib-bsearch.h:21:24: note: expected ‘int (*)(const void *, const void *)’ but argument is of type ‘int (*)(const char **, const char **)’
   21 |          __compar_fn_t __compar)
      |          ~~~~~~~~~~~~~~^~~~~~~~
rman.c: In function ‘source_command’:
rman.c:4174:44: warning: passing argument 1 of ‘source_out’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 4174 |          if (fcharout) { source_out(tcltkOP[i]); source_out(": "); }
      |                                     ~~~~~~~^~~
rman.c:3558:24: note: expected ‘char *’ but argument is of type ‘const char *’
 3558 | char *source_out(char *p) {
      |                  ~~~~~~^
rman.c: In function ‘main’:
rman.c:4669:61: error: passing argument 4 of ‘qsort’ from incompatible pointer type [-Wincompatible-pointer-types]
 4669 |         qsort(lcexceptions, lcexceptionslen, sizeof(char*), lcexceptionscmp);
      |                                                             ^~~~~~~~~~~~~~~
      |                                                             |
      |                                                             int (*)(const char **, const char **)
/usr/include/stdlib.h:971:34: note: expected ‘__compar_fn_t’ {aka ‘int (*)(const void *, const void *)’} but argument is of type ‘int (*)(const char **, const char **)’
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
make: *** [Makefile:100: rman] Error 1
 * ERROR: app-text/rman-3.2-r1::text-kit failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=app-text/rman-3.2-r1::text-kit'`,
 * the complete build log and the output of `emerge -pqv '=app-text/rman-3.2-r1::text-kit'`.
 * The complete build log is located at '/var/tmp/portage/app-text/rman-3.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-text/rman-3.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-text/rman-3.2-r1/work/rman-3.2'
 * S: '/var/tmp/portage/app-text/rman-3.2-r1/work/rman-3.2'

>>> Failed to emerge app-text/rman-3.2-r1, Log file:

Tested new patch from gentoo solved this issue:

rman-3.2-incompatible-pointer-types.patch
From 1120713781a5da03a56d3f8d59904c0fd20f6dd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
 <leohdz172@proton.me>
Date: Mon, 11 Dec 2023 17:05:26 -0600
Subject: [PATCH] fix build with -Werror=incompatible-pointer-types
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Leonardo Hernández Hernández <leohdz172@proton.me>
--- a/rman.c
+++ b/rman.c
@@ -268,7 +268,7 @@ stricmp(const char *s1, const char *s2) {
 	else return 1;
 }

-int lcexceptionscmp(const char **a, const char **b) { return stricmp(*a, *b); }
+int lcexceptionscmp(const void *a, const void *b) { return stricmp((const char *)a, (const char *)b); }

 int
 strincmp(const char *s1, const char *s2, size_t n) {
--
2.43.0

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rman.c, especially lcexceptionscmp and the qsort/bsearch calls shown in the build log. Check the supplied incompatible-pointer-types patch, then rebuild app-text/rman-3.2-r1 with GCC 14 to confirm compilation succeeds without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.