1e16abd
Patch from Andreas Stührk <andy@hammerhartes.de> to work around build
1e16abd
failures with GCC >= 6 like:
988ed3a
988ed3a
In file included from kcdbext.cc:16:0:
988ed3a
kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
988ed3a
kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return
988ed3a
       return false;
988ed3a
              ^~~~~
988ed3a
In file included from kclangc.cc:17:0:
988ed3a
kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
988ed3a
kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return
988ed3a
       return false;
988ed3a
              ^~~~~
988ed3a
1e16abd
Note that using '\0' rather nullptr (like the patch from openSUSE is
1e16abd
doing) just leads to new build failures with GCC >= 7 like:
1e16abd
1e16abd
In file included from kcdbext.cc:16:0:
1e16abd
kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
1e16abd
kcdbext.h:1281:14: error: invalid conversion from 'char' to 'char*' [-fpermissive]
1e16abd
       return '\0';
1e16abd
              ^~~~
1e16abd
In file included from kclangc.cc:17:0:
1e16abd
kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
1e16abd
kcdbext.h:1281:14: error: invalid conversion from 'char' to 'char*' [-fpermissive]
1e16abd
       return '\0';
1e16abd
              ^~~~
1e16abd
988ed3a
See also:
988ed3a
988ed3a
 - https://bugzilla.redhat.com/show_bug.cgi?id=1307706
988ed3a
 - https://build.opensuse.org/package/view_file/devel:libraries:c_c++/kyotocabinet/gcc6-fix-errors.patch?expand=1
1e16abd
 - https://bugs.debian.org/811627
988ed3a
988ed3a
--- kyotocabinet-1.2.76/kcdbext.h	2016-05-25 11:32:53.591866016 +0200
988ed3a
+++ kyotocabinet-1.2.76/kcdbext.h	2012-05-24 18:27:59.000000000 +0200
988ed3a
@@ -1278,7 +1278,7 @@
988ed3a
     if (omode_ == 0) {
988ed3a
       set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened");
988ed3a
       *sp = 0;
988ed3a
-      return false;
1e16abd
+      return nullptr;
988ed3a
     }
988ed3a
     if (!cache_) return db_.get(kbuf, ksiz, sp);
988ed3a
     size_t dvsiz = 0;