mattgodbolt / zindex

Create an index on a compressed text file
BSD 2-Clause "Simplified" License
620 stars 37 forks source link

Compilation fails with Clang #9

Closed sakra closed 9 years ago

sakra commented 9 years ago

Trying to build zindex with clang under OS X 10.10 results in the following error:

In file included from /Users/kratky/Downloads/zindex-master/tests/LineFinderTest.cpp:4:"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:823:34: error: comparison of integers of different signs: 'unsigned long long' and 'int' [-Werror,-Wsign-compare]"
            return opCast( lhs ) ==  opCast( rhs );"
                   ~~~~~~~~~~~~~ ^   ~~~~~~~~~~~~~"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:868:39: note: in instantiation of member function 'Catch::Internal::Evaluator<unsigned long long, int, 0>::evaluate' requested here"
        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );"
                                      ^"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:1287:39: note: in instantiation of function template specialization 'Catch::Internal::compare<0, unsigned long long, int>' requested here"
            .setResultType( Internal::compare<Op>( m_lhs, rhs ) )"
                                      ^"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:1230:16: note: in instantiation of function template specialization 'Catch::ExpressionLhs<const unsigned long long &>::captureExpression<0, int>' requested here"
        return captureExpression<Internal::IsEqualTo>( rhs );"
               ^"
/Users/kratky/Downloads/zindex-master/tests/LineFinderTest.cpp:38:41: note: in instantiation of function template specialization 'Catch::ExpressionLhs<const unsigned long long &>::operator==<int>' requested here"
        REQUIRE(finder.lineOffsets()[0] == 0);"
                                        ^"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:8918:46: note: expanded from macro 'REQUIRE'"
#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )"
                                             ^"
/Users/kratky/Downloads/zindex-master/tests/catch.hpp:1478:31: note: expanded from macro 'INTERNAL_CATCH_TEST'"
            ( __catchResult->*expr ).endExpression(); \"

$ clang --version Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix

mattgodbolt commented 9 years ago

Thanks! I'm not sure what's going on there; ideas welcomed. The travis CI build builds against clang 3.6 ok, I wonder if this is a OS thing? Any ideas welcomed!

sakra commented 9 years ago

I have created a pull request.

mattgodbolt commented 9 years ago

Thanks so much: however it seems not to build on Linux: https://travis-ci.org/mattgodbolt/zindex/jobs/60975277 -- any ideas? I'll dig in a bit (am not at my computer at the moment) - looks like pthread's needed on Linux. My cmake-fu isn't all that strong (this is the first time I've used it!) but I'm sure we can fix it.

I'll also look into making sure travis builds on OSX too.

On Sat, May 2, 2015 at 2:11 PM, Sascha Kratky notifications@github.com wrote:

I have created a pull request.

— Reply to this email directly or view it on GitHub https://github.com/mattgodbolt/zindex/issues/9#issuecomment-98387696.

Matt

mattgodbolt commented 9 years ago

The patches supplied now fix this: thanks so much!