Add optional clang compile mode

Summary:
clang is an alternate compiler based on llvm.  It produces
nicer error messages and finds some bugs that gcc doesn't, such as the
size_t change in this file (which caused some write return values to be
misinterpreted!)

Clang isn't the default; to try it, do "USE_CLANG=1 make" or "export
USE_CLANG=1" then make as normal

Test Plan: "make check" and "USE_CLANG=1 make check"

Reviewers: dhruba

Reviewed By: dhruba

Differential Revision: https://reviews.facebook.net/D7899
This commit is contained in:
Chip Turner
2013-01-14 18:37:01 -08:00
parent 9bbcab57a9
commit a2dcd79c1e
7 changed files with 81 additions and 33 deletions

View File

@@ -411,12 +411,14 @@ static bool ZlibCompressionSupported() {
&out);
}
#ifdef BZIP2
static bool BZip2CompressionSupported() {
std::string out;
Slice in = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
return port::BZip2_Compress(Options().compression_opts, in.data(), in.size(),
&out);
}
#endif
enum TestType {
TABLE_TEST,