Created attachment 212724 [details]
Failing portion of compilation log
After installing devel/llvm10 from a port, I tried to recompile our server's software with it, especially varnish as it recently fell over when we didn't (it relies on the version of llvm it is compiled with being there on startup, and we'd removed it).
Unfortunately there is a new error (from a new warning) - basically LONG_MAX overflows the value that can be precisely represented within a double by about 11 bits of precision.
The master version has a comment regarding this:
* technically, as our VCL_INT is int64_t, its limits are INT64_MIN/INT64_MAX.
* Yet, for conversions, we use VNUMpfx with a double intermediate, so above
* 2^53 we see rounding errors. In order to catch a potential floor rounding
* error, we make our limit 2^53-1
This appears to have been applied in Commit 0f7f757c "sensible limits for VCL_INT and VCL_BYTES"
but it was later moved purely into vmod_std_conversions.c
varnish 4.1 seems to use LONG_MAX/MIN rather than INT64_MAX/MIN and the only functions concerned are vmod_real2integer and vmod_time2integer because vmod_integer concerns an int, not a long, so it doesn't have that check. (This change was made in https://varnish-cache.org/lists/pipermail/varnish-commit/2012-October/009180.html - "Change VCL::INT from C::int to C::long to gain more range on 64bit architectures.")
I created a patch. Adding this to files/ adjusting the Makefile accordingly:
causes compilation to succeed again with clang10.
Don't know if you want to apply it, but varnish 4.1 is still supported, I'm using it, and in fact there's a new version, 4.1.11, released February 11:
Created attachment 212725 [details]
Patch for lib/libvmod_std/vmod_std_conversions.c