Skip to content

Initializer-overrides warnings

Thomas Andersen requested to merge phomes/mesa:initilizer-overrides-gcc into main

Warnings about initializer overrides are a mixed bag. Sometimes they find real bugs but sometimes they just warn about intended overrides.

Clang has -Winitializer-overrids in -Wall. The GCC counterpart is -Woverride-init and is in -Wextra. We therefore see this type of warning only on clang by default.

To make clang warning-clean and thus able to build in CI without any no-error=* the relevant warnings have been corrected. In this MR the few cases of intentional overrides are ignored with #pragma's.

Clang will now spot regressions in the CI. To avoid having to catch all new warnings late in the CI -Woverride-init is also added to the default warnings flags. Developers using GCC will now see the warnings before hitting them in the CI.

Merge request reports