Clang warning free
This is a tracker issue for the clang warning MRs.
GCC and clang each spot different things with their warnings. Building with GCC is mostly free of warnings. Clang however produces a ton of warnings. This makes it hard to spot new issues detectable with clang.
To prevent the situation from getting worse the CI is building with clang and -Werror, but with a list of exceptions for the existing warning types.
The first cleanup was easy as there were many exceptions for warnings that we were not hitting. I suspect that the removal of the classic drivers helped here? The cleanup happened in !14269 (merged)
Some drivers (Gallium: i915 + asahi. Vulkan: swrast + panfrost) were not being built with clang in CI. They were fixed to be error free and got added to the list in !14289 (merged)
I welcome any help in getting rid of these warnings. Especially for C++ as I have not looked at those very much yet.
Many of the exceptions are also set for the android CI. Maybe they can be removed there as well. I do not
know how to build that, but perhaps someone would be willing to see if the same can be removed there?
Android CI: !14638 (merged) !14639 (merged) !14654 (merged)
Some of the warning types we fix here do not affect the CI today. They only warn in clang versions later than 11, which is what we use in CI today.
Here is a list of the warning types and the MRs to fix them.
C
-
absolute-value !14302 (merged) -
bitwise-instead-of-logical !14315 (merged) -
constant-conversion !14304 (merged) + !14306 -
enum-conversion -
implicit-const-int-float-conversion -
implicit-fallthrough !14252 (merged) -
initializer-overrides !14587 -
self-assign !14272 (merged) -
sometimes-uninitialized !14629 -
unused-but-set-variable !14303 (closed) -
unused-function !14470 (closed)
C++
-
c99-designator -
deprecated-declarations N/A -
implicit-cjavascript:;onst-int-float-conversion -
missing-braces -
overloaded-virtual -
sometimes-uninitialized !14296 (merged) -
tautological-constant-out-of-range-compare -
unused-but-set-variable !14303 (closed) -
unused-const-variable -
unused-private-field
In addition to the removal there is also one exception being added. deprecated-declarations. It is already there for C++ but not C. When upgrading LLVM we get a lot of these and I don't think the CI should fail for those. Added in !14628 (closed)
In case someone wants to help out. The way that I use the same build configuration as the CI is by:
CC=clang CXX=clang++ meson build -Dgallium-drivers="iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi" -Dvulkan-drivers="intel,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost" -Dglvnd=true -Dbuild-tests=true -Dbuildtype=debug -D libunwind=enabled
meson compile -C build'