Submitted fixes to upstream. Let them review them before going forward with fixing freeciv copy.
Patches submitted to upstream attached also here.
This has been an issue at least since clang-7, according to my earlier report: https://www.hostedredmine.com/issues/802795
Upstream has accepted these.
This needs to be backported to S2_6 now - Void Linux / musl requires it. S3_0 patch applies there.
In S3_0 (haven't tested later branches) all the luasql backends fail to build with clang-14 & -Werror.