LMS-Community/slimserver-vendor

libicu does not compile on clang

mnd999 opened this issue · 13 comments

Presumably fixed in a more recent libicu

uspoof.cpp:369:22: error: ordered comparison between pointer and zero ('int32_t *' (aka 'int *') and 'int')
        if (position > 0) {
            ~~~~~~~~ ^ ~

You're on FreeBSD, aren't you? Did you try a newer version?

Yes, on FreeBSD. It's easily fixed, and was fixed by libicu about 5 years ago:

https://ssl.icu-project.org/trac/changeset/32912

Probably LMS needs to update libicu.

A current libicu may well work, but it's a difficult upgrade to do as the build seems to include it's own data file. The comment says:

Replace huge data file with smaller one containing only our collations

There is no indication (AFAICT) how the smaller file was generated or what it contains so it's not easy to see how to proceed other than getting rid of this step and sticking with the original file.

Did you see @fsbruva's series of pull requests for FreeBSD? They might help you get over this issue.

It's not a FreeBSD issue, it was but it's easy enough to patch. The issue is libicu is massively out of date and has no clear upgrade path because the current version contains modifications that afaict are unknown and were done for unknown reasons and therefore cannot be reproduced on a current version.

The FreeBSD PR doesn't even patch it - it just forces GCC.

@fsbruva I know, I wrote the patch.

The purpose of this issue is to discuss whether we can upstream a proper fix by using a lest old libicu I guess.

What version of FreeBSD are you building on? Which compiler?

FreeBSD 11.1, which ships with

$ clang --version
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin

It's actually a clang 4.0.0 issue. LibICU builds successfully with clang 3.8.0.

Clang 4.0.0 treats a bug as an error, Clang 3.8.0 treats it as a warning. Some might call that an improvement. I can see I'm wasting my time here, if I have to explain why using a version of this library that old, having no upgrade path for it and blaming new compilers for finding old bug are all problems.