hashdeep: fix compilation with GCC11
authorRosen Penev <rosenp@gmail.com>
Wed, 7 Jul 2021 03:05:24 +0000 (20:05 -0700)
committerRosen Penev <rosenp@gmail.com>
Wed, 7 Jul 2021 21:53:25 +0000 (14:53 -0700)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
utils/hashdeep/Makefile
utils/hashdeep/patches/010-gcc11.patch [new file with mode: 0644]

index 673d389c0b40fa54ef2b603f3b2f058116037bda..3a706ae8b4228c585c121417e7d7f548d23be53d 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hashdeep
 PKG_VERSION:=4.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/jessek/hashdeep/tar.gz/v$(PKG_VERSION)?
diff --git a/utils/hashdeep/patches/010-gcc11.patch b/utils/hashdeep/patches/010-gcc11.patch
new file mode 100644 (file)
index 0000000..f9606c0
--- /dev/null
@@ -0,0 +1,27 @@
+From 6ef69a26126ee4e69a25392fd456b8a66c51dffd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Nov 2016 02:46:55 +0000
+Subject: [PATCH] Fix errors found by clang
+
+Fixes errors like
+
+../../git/src/hash.cpp:282:19: error: ordered comparison between pointer and zero ('const unsigned char *' and 'int')
+            if(fdht->base>0){
+               ~~~~~~~~~~^~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/hash.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/hash.cpp
++++ b/src/hash.cpp
+@@ -279,7 +279,7 @@ void file_data_hasher_t::hash()
+               MAP_FILE|
+ #endif
+               MAP_SHARED,fd,0);
+-          if(fdht->base>0){           
++          if(fdht->base != (void *) -1){
+               /* mmap is successful, so set the bounds.
+                * if it is not successful, we default to reading the fd
+                */