Dushistov / sdcv

https://dushistov.github.io/sdcv/
GNU General Public License v2.0
294 stars 42 forks source link

sdcv 0.5.1 build error on 32bit system #19

Closed citrin closed 7 years ago

citrin commented 7 years ago

sdcv fails to build on FreeBSD i386 with clang 3.8 Error is:

sdcv-0.5.1/src/libwrapper.cpp:325:9: error: use of overloaded operator '[]' is ambiguous (with operand types 'glib::CharStr' (aka 'ResourceWrapper<char, void, g_free>') and 'int')
        if (str[0] == '\0')
            ~~~^~
sdcv-0.5.1/src/utils.hpp:18:14: note: candidate function
    const T& operator[](size_t idx) const {
             ^
sdcv-0.5.1/src/libwrapper.cpp:325:9: note: built-in candidate operator[](struct ResourceWrapper<char, void, &g_free>::Tester *, int)
        if (str[0] == '\0')
               ^
sdcv-0.5.1/src/libwrapper.cpp:325:9: note: built-in candidate operator[](const struct ResourceWrapper<char, void, &g_free>::Tester *, int)
sdcv-0.5.1/src/libwrapper.cpp:325:9: note: built-in candidate operator[](volatile struct ResourceWrapper<char, void, &g_free>::Tester *, int)
sdcv-0.5.1/src/libwrapper.cpp:325:9: note: built-in candidate operator[](const volatile struct ResourceWrapper<char, void, &g_free>::Tester *, int)
1 error generated.
Dushistov commented 7 years ago

Feel free to repoen if b2ced870abf9df71e6efff3244eb6fb40e46a449 not fix it for you.

citrin commented 7 years ago

Now with clang 3.4.1 I see an error:

sdcv-0.5.1/src/utils.hpp:30:63: error: unknown type name 'nullptr_t'; did you mean 'std::nullptr_t'?
    friend inline bool operator==(const ResourceWrapper& lhs, nullptr_t) noexcept {
                                                              ^~~~~~~~~
                                                              std::nullptr_t
/usr/include/c++/v1/cstddef:97:31: note: 'std::nullptr_t' declared here
    typedef decltype(nullptr) nullptr_t;
                              ^

Probably be nullptr_t better to spell as std::nullptr_t