From 03d440cc8e8debc989656e7e09415ddeb8ff4c15 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Fri, 20 Dec 2024 01:28:20 +0000 Subject: [PATCH] testdisk: fix gcc-14 build fix incompatible pointer type by updating a function definition ntfs_device_testdisk_io_ioctl to take an unsigned long rather than an int. The function implementation is empty and just returns error so the updated argument type has no effect. --- pkgs/tools/system/testdisk/default.nix | 4 ++++ pkgs/tools/system/testdisk/gcc-14-fixes.diff | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/tools/system/testdisk/gcc-14-fixes.diff diff --git a/pkgs/tools/system/testdisk/default.nix b/pkgs/tools/system/testdisk/default.nix index 748231da47b6..810d6a8cf7f2 100644 --- a/pkgs/tools/system/testdisk/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -33,6 +33,10 @@ assert enableQt -> qwt != null; sha256 = "1zlh44w67py416hkvw6nrfmjickc2d43v51vcli5p374d5sw84ql"; }; + patches = [ + ./gcc-14-fixes.diff + ]; + postPatch = '' substituteInPlace linux/qphotorec.desktop \ --replace "/usr" "$out" diff --git a/pkgs/tools/system/testdisk/gcc-14-fixes.diff b/pkgs/tools/system/testdisk/gcc-14-fixes.diff new file mode 100644 index 000000000000..df4fc9140ead --- /dev/null +++ b/pkgs/tools/system/testdisk/gcc-14-fixes.diff @@ -0,0 +1,15 @@ +diff --git a/src/ntfs_io.c b/src/ntfs_io.c +index 7f57edd..4b718bb 100644 +--- a/src/ntfs_io.c ++++ b/src/ntfs_io.c +@@ -154,8 +154,8 @@ static int ntfs_device_testdisk_io_stat(struct ntfs_device *dev, struct stat *bu + return -1; + } + +-static int ntfs_device_testdisk_io_ioctl(struct ntfs_device *dev, int request, +- void *argp) ++static int ntfs_device_testdisk_io_ioctl(struct ntfs_device *dev, ++ unsigned long request, void *argp) + { + log_warning( "ntfs_device_testdisk_io_ioctl() unimplemented\n"); + #ifdef ENOTSUP