From 8f8cc1668e47d69ac735b8764d7a80babb45b079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Fri, 20 Oct 2023 01:02:58 +0000 Subject: [PATCH] Globally disable -Wreorder-init-list. This warning is triggered even when initializers don't have any side effects, so it very rarely surfaces actual bugs/mistakes. 99% of the time it complains about a purely cosmetic issue. Disable it by default in commonGlobalCFlags, which still allows individual modules to opt into it. Bug: 145210666 Test: presubmit Change-Id: I671b5c457ee3d92b9cc37f020ba54e01e1a04f59 --- cc/config/global.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cc/config/global.go b/cc/config/global.go index 62b008b06..123037019 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -69,8 +69,6 @@ var ( // Making deprecated usages an error causes extreme pain when trying to // deprecate anything. "-Wno-error=deprecated-declarations", - // This rarely indicates a bug. http://b/145210666 - "-Wno-error=reorder-init-list", // Warnings disabled by default. @@ -86,6 +84,14 @@ var ( // subsequent version of an interface, so this warning is currently // infeasible to enable. "-Wno-inconsistent-missing-override", + // Detects designated initializers that are in a different order than + // the fields in the initialized type, which causes the side effects + // of initializers to occur out of order with the source code. + // In practice, this warning has extremely poor signal to noise ratio, + // because it is triggered even for initializers with no side effects. + // Individual modules can still opt into it via cflags. + "-Wno-error=reorder-init-list", + "-Wno-reorder-init-list", // Incompatible with the Google C++ style guidance to use 'int' for loop // indices; poor signal to noise ratio. "-Wno-sign-compare",