From bf14d3d0d10f54266fe0b3b1289002831f0c3fdd Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Feb 02 2024 16:48:28 +0000 Subject: Adapt pointer types to GCC 14 --- diff --git a/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch b/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch new file mode 100644 index 0000000..1ed7dae --- /dev/null +++ b/nas-1.9.5-Correct-pointer-types-for-GCC-14.patch @@ -0,0 +1,108 @@ +From cffa7bbc124f775520914a0cfb0ede619a05e07d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Fri, 2 Feb 2024 16:05:11 +0100 +Subject: [PATCH] Correct pointer types for GCC 14 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 14 became pickier about pointer types: + +auth.c:71:26: error: initialization of ‘int (*)()’ from incompatible pointer type ‘int (*)(short unsigned int, char *)’ [-Wincompatible-pointer-types] + 71 | MitToID, MitFromID, MitRemoveCookie, + | ^~~~~~~~~~~~~~~ + +Including const correctness: + +audemo.c: In function ‘rescanCB’: +audemo.c:524:23: error: passing argument 2 of ‘XawListChange’ from incompatible pointer type [-Wincompatible-pointer-types] + 524 | makeFileList(globals->fileNames, globals->numFiles), + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + | | + | char ** + +This patch fixes these errors. + +Signed-off-by: Petr Písař +--- + clients/audio/audemo/audemo.c | 28 ++++++++++++++-------------- + server/os/auth.c | 2 +- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/clients/audio/audemo/audemo.c b/clients/audio/audemo/audemo.c +index 5617cf7..e77b95d 100644 +--- a/clients/audio/audemo/audemo.c ++++ b/clients/audio/audemo/audemo.c +@@ -500,11 +500,11 @@ newBucketCB(Widget w, XtPointer globalsp, XtPointer call_data) + static void + rescanCB(Widget w, XtPointer globalsp, XtPointer call_data) + { +- GlobalDataPtr globals = (GlobalDataPtr) globalsp; +- static char *noFilesString = "No files found"; +- char *dir, +- *template; +- int i; ++ GlobalDataPtr globals = (GlobalDataPtr) globalsp; ++ static const char *noFilesString = "No files found"; ++ char *dir, ++ *template; ++ int i; + + if (globals->numFiles) + { +@@ -521,7 +521,7 @@ rescanCB(Widget w, XtPointer globalsp, XtPointer call_data) + if (globals->numFiles) + { + XawListChange(globals->samples, +- makeFileList(globals->fileNames, globals->numFiles), ++ (const char **)makeFileList(globals->fileNames, globals->numFiles), + globals->numFiles, -1, True); + XtSetSensitive(globals->samples, True); + } +@@ -591,13 +591,13 @@ bucketPlayCB(Widget w, XtPointer globalsp, XtPointer call_data) + static void + bucketQueryCB(Widget w, XtPointer globalsp, XtPointer call_data) + { +- GlobalDataPtr globals = (GlobalDataPtr) globalsp; ++ GlobalDataPtr globals = (GlobalDataPtr) globalsp; + BucketDialogDataPtr buf = &globals->buf; +- char tmp[200], +- access[4], +- desc[COMMENT_LEN]; +- int i; +- static char *noBucketString = "No buckets"; ++ char tmp[200], ++ access[4], ++ desc[COMMENT_LEN]; ++ int i; ++ static const char *noBucketString = "No buckets"; + + if (buf->numBuckets) + { +@@ -652,8 +652,8 @@ bucketQueryCB(Widget w, XtPointer globalsp, XtPointer call_data) + + if (buf->numBuckets) + { +- XawListChange(buf->bucketList, buf->bucketText, buf->numBuckets, -1, +- True); ++ XawListChange(buf->bucketList, (const char **)buf->bucketText, ++ buf->numBuckets, -1, True); + XtSetSensitive(buf->bucketList, True); + } + else +diff --git a/server/os/auth.c b/server/os/auth.c +index a80a257..9488db7 100644 +--- a/server/os/auth.c ++++ b/server/os/auth.c +@@ -55,7 +55,7 @@ struct protocol { + int (*Reset) (); /* delete all authorization data entries */ + AuID(*ToID) (); /* convert cookie to ID */ + int (*FromID) (); /* convert ID to cookie */ +- int (*Remove) (); /* remove a specific cookie */ ++ int (*Remove) (unsigned short, char *); /* remove a specific cookie */ + }; + + extern int MitAddCookie(); +-- +2.43.0 + diff --git a/nas.spec b/nas.spec index 860c8f0..df13a6f 100644 --- a/nas.spec +++ b/nas.spec @@ -1,7 +1,7 @@ Name: nas Summary: The Network Audio System (NAS) Version: 1.9.5 -Release: 8%{?dist} +Release: 9%{?dist} URL: http://radscan.com/nas.html # README: MIT (main license) # lib/audio/aiff.c MIT (with Apple warranty declaration) @@ -34,6 +34,9 @@ Patch1: nas-1.9.5-No-implicit-ints-and-function-declarations.patch # Respect linker flags when linking shared libraries, in upstream after 1.9.5, # Patch2: nas-1.9.5-Pass-extra-linker-flags-to-shared-libraries.patch +# Adapt pointer types to GCC 14, bug #2261396, proposed to the upstream, +# +Patch3: nas-1.9.5-Correct-pointer-types-for-GCC-14.patch BuildRequires: bison BuildRequires: flex BuildRequires: gcc @@ -148,6 +151,9 @@ rm -fv $RPM_BUILD_ROOT%{_libdir}/lib*.a %changelog +* Fri Feb 02 2024 Petr Pisar - 1.9.5-9 +- Adapt pointer types to GCC 14 (bug #2261396) + * Thu Jan 25 2024 Fedora Release Engineering - 1.9.5-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild