summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@landless-city.net>2024-04-09 00:39:17 +0500
committerFlorian Schmaus <flow@gentoo.org>2024-07-03 13:54:39 +0200
commit6f2cf69b4c38e3e43c274a2741274d21dc41d6f1 (patch)
tree2bd23e01511d9d350676cea96f573a83f05d3444 /net-p2p/ncdc/files
parentsys-kernel/gentoo-sources: stable 6.6.30 for hppa, auto stable timeout (diff)
downloadgentoo-6f2cf69b4c38e3e43c274a2741274d21dc41d6f1.tar.gz
gentoo-6f2cf69b4c38e3e43c274a2741274d21dc41d6f1.tar.bz2
gentoo-6f2cf69b4c38e3e43c274a2741274d21dc41d6f1.zip
net-p2p/ncdc: fix building with Clang 16 for 1.24
Release 1.23.1 is unaffected. All information is in the patch. Upstream PR: https://code.blicky.net/yorhel/ncdc/pulls/108 . Closes: https://bugs.gentoo.org/928946 Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net> Closes: https://github.com/gentoo/gentoo/pull/36167 Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'net-p2p/ncdc/files')
-rw-r--r--net-p2p/ncdc/files/ncdc-1.24-fix-clang16-c99-errors.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/net-p2p/ncdc/files/ncdc-1.24-fix-clang16-c99-errors.patch b/net-p2p/ncdc/files/ncdc-1.24-fix-clang16-c99-errors.patch
new file mode 100644
index 000000000000..4be7472e00fd
--- /dev/null
+++ b/net-p2p/ncdc/files/ncdc-1.24-fix-clang16-c99-errors.patch
@@ -0,0 +1,72 @@
+Upstream PR: https://code.blicky.net/yorhel/ncdc/pulls/108 .
+
+From 42590da4741baf93889773df96e0f3546d2e7f20 Mon Sep 17 00:00:00 2001
+From: Eric Joldasov <bratishkaerik@landless-city.net>
+Date: Tue, 9 Apr 2024 00:09:53 +0500
+Subject: [PATCH] Fix Clang 16 errors for invalid C99 constructs
+ (-Wincompatible-pointer-types)
+
+These errors were caused by `t_title` function having "void" parameter
+instead of "ui_tab_t *tab", like everywhere else:
+
+```
+src/uit_conn.c:398:41: error: initialization of char * (*)(ui_tab_t *) from incompatible pointer type char * (*)(void) [-Wincompatible-pointer-types]
+ 398 | ui_tab_type_t uit_conn[1] = { { t_draw, t_title, t_key, t_close } };
+ | ^~~~~~~
+```
+
+Also renamed `t` param in `t_title` of "src/uit_main.c" to `tab`,
+for consistency with other functions.
+
+This error appeared only in 1.24 release cycle, because changing
+prototypes from "()" to "(void)" in 2cf47a7ec9f35d1afaf24a6f9644fbecf6df92df
+changed meaning of the type from "any parameters, including ui_tab_t *"
+to "no parameters at all", and this is where Clang starts to complain.
+
+Bug: https://bugs.gentoo.org/928946
+Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
+---
+ src/uit_conn.c | 2 +-
+ src/uit_dl.c | 2 +-
+ src/uit_main.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/uit_conn.c b/src/uit_conn.c
+index f0fa171..ba00cb3 100644
+--- a/src/uit_conn.c
++++ b/src/uit_conn.c
+@@ -97,7 +97,7 @@ static void t_close(ui_tab_t *tab) {
+ }
+
+
+-static char *t_title(void) {
++static char *t_title(ui_tab_t *tab) {
+ return g_strdup("Connection list");
+ }
+
+diff --git a/src/uit_dl.c b/src/uit_dl.c
+index 118f323..f8cda84 100644
+--- a/src/uit_dl.c
++++ b/src/uit_dl.c
+@@ -124,7 +124,7 @@ static void t_close(ui_tab_t *tab) {
+ }
+
+
+-static char *t_title(void) {
++static char *t_title(ui_tab_t *tab) {
+ return g_strdup("Download queue");
+ }
+
+diff --git a/src/uit_main.c b/src/uit_main.c
+index e3fdfad..79b3ffa 100644
+--- a/src/uit_main.c
++++ b/src/uit_main.c
+@@ -65,7 +65,7 @@ static void t_draw(ui_tab_t *t) {
+ }
+
+
+-static char *t_title(ui_tab_t *t) {
++static char *t_title(ui_tab_t *tab) {
+ return g_strdup_printf("Welcome to ncdc %s!", main_version);
+ }
+