WEVERYTHING enables on Clang literally every warning. People on the
internet are divided if this is a good thing or not but ClickHouse
compiles with -Weverything + some exceptions for noisy warnings since at
least a year.
I tried to build with WEVERYTHING = OFF and the build was badly broken.
It seems nobody actually turns WEVERYTHING off. Actually, why would one
if the CI builds (configured with WEVERYTHING = ON) potentially generate
errors not generated in local development.
To simplify the build scripts and to remove the need to maintain two
sets of compiler warnings, I made WEVERYTHING the default and threw
WEVERYTHING = OFF out.
Since libstdc++ has some of such compares for 3way compare:
/src/ch/clickhouse/src/Common/UInt128.h:61:71: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
bool inline operator>= (const UInt128 rhs) const { return tuple() >= rhs.tuple(); }
^~
nullptr
/usr/include/c++/10.2.0/tuple:1426:5: note: while rewriting comparison as call to 'operator<=>' declared here
operator<=>(const tuple<_Tps...>& __t, const tuple<_Ups...>& __u)
clang (10.0.0 is fine BTW) will warn about this anyway on CI.
For the debug build gcc10:
- before patch:
- concat.cpp -> >5m (stuck on cc1plus, not as)
- has.cpp -> >10m (stuck on cc1plus, not as)
- after this patch:
- concat.cpp -> 1m16s
- has.cpp -> 4m (and most of the time eats, as from binutils 2.34.50.20200508)
Command for build:
- ninja src/Functions/GatherUtils/CMakeFiles/clickhouse_functions_gatherutils.dir/concat.cpp.o
- ninja src/Functions/GatherUtils/CMakeFiles/clickhouse_functions_gatherutils.dir/has.cpp.o
The test case should be reduced and then it can be reported to the gcc
bugzilla.
P.S. Looks like a signal not to switch to gcc10 for now