secure411dotorg/mal4s

Fails to build with latest clang

Closed this issue · 1 comments

The error is the following:

src/dirnode.cpp:578:27: error: no matching function for call to 'max'
    this->parent_radius = std::max(1.0, sqrt(total_file_area) * gGourceDirPadding);
                          ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2611:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('double' vs. 'float')
max(const _Tp& __a, const _Tp& __b)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2621:1: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'double'
max(initializer_list<_Tp> __t, _Compare __comp)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2603:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:2629:1: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
max(initializer_list<_Tp> __t)
^

with Xcode 9 on macOS 10.13. The constant 1.0 should be 1.0f like everywhere else.

The build is successful after merging pull request #45