Bool vs char * conversion

I have a problem at make step to install a downloaded package consisted of different programs.

In file included from kcdbext.cc:16:0:
kcdbext.h: In member function �char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
kcdbext.h:1281:14: error: cannot convert �bool' to �char*' in return
       return false;

1) I have tried

export LANG="en_US.UTF-8"; make 

to correct the weird characters, but this seems to be a temporary fix. What is the permanent fix?
2) The error message is

kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)':
kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return:
       return false;

The code fragment of the function prototype is:

char* get(const char* kbuf, size_t ksiz, size_t* sp) {
if (omode_ == 0) {
     //......
     return false;
   }

//more code ...
return rbuf;
}

I know the function is declared as char *, which is conflict with the returned value as a boolean "false". How to fix this syntax problem?
Thanks a lot!

That is very strange. 'false' really does not belong there and never did, no idea what the writer of that function was doing.

I can't tell you what the right value to return is without examining that entire function and possibly a lot more.

1 Like

Thanks!
It is a too long code to attach it here. I may need to go back to check the code again. The machine is:

Linux yt2 4.3.0-1-amd64 #1 SMP Debian 4.3.3-5 (2016-01-04) x86_64 GNU/Linux
Thread model: posix
gcc version 6.2.0 20161027 (Debian 6.2.0-10)

On another machine with smaller RAM, I only got warning but not error on it, and it went through to have all the programs compiled.

Linux HPCompaq 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

Is there any option(s) that I may have missed from the compiling part? Thanks again.

No idea. Not enough information.