mhash.h fails to compile with clang++ -std=c++14
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mhash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
mhash.h fails to compile with clang++ when -std=c++14 or any of the other c++ standards is enabled. The problem is that mhash uses _Bool, but clang only defines _Bool in C mode, not in C++ mode:
/usr/lib/
Fixing the problem can be done by replacing '_Bool' with 'bool' in:
/usr/include/
As far as I understand it using _Bool directly is not advised:
http://
Example of the problem:
$ cat main.cpp
#include <mhash.h>
int main() {}
$ clang++ main.cpp $(pkg-config --cflags --libs mhash) -std=c++14
In file included from main.cpp:1:
In file included from /usr/include/
In file included from /usr/include/
/usr/include/
mutils_word32 *mutils_
/usr/include/
#define mutils_boolean _Bool
/usr/include/
mutils_boolean mutils_
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash(MHASH thread, const void *plaintext, mutils_word32 size);
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash_hmac_
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash_save_
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash_keygen_
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash_keygen_
^
/usr/include/
#define mutils_boolean _Bool
In file included from main.cpp:1:
In file included from /usr/include/
/usr/include/
mutils_boolean mhash_keygen_
^
/usr/include/
#define mutils_boolean _Bool
8 errors generated.