Blame SOURCES/0050-Make-add-Wno-missing-field-initializers.patch

d5c737
From 1b5da030b19e6f7f086ef2f1719159951c574fa7 Mon Sep 17 00:00:00 2001
d5c737
From: Peter Jones <pjones@redhat.com>
d5c737
Date: Tue, 15 Oct 2019 16:49:54 -0400
d5c737
Subject: [PATCH 50/63] Make: add -Wno-missing-field-initializers
d5c737
MIME-Version: 1.0
d5c737
Content-Type: text/plain; charset=UTF-8
d5c737
Content-Transfer-Encoding: 8bit
d5c737
d5c737
Ritchie wrote in '84:
d5c737
d5c737
 If there are fewer initializers in the list than there are members of
d5c737
 the aggregate, then the aggregate is padded with 0's.
d5c737
d5c737
c99 §6.7.8 and c11 §6.7.9 each say:
d5c737
d5c737
 10 If an object that has automatic storage duration is not initialized
d5c737
    explicitly, its value is indeterminate. If an object that has static
d5c737
    storage duration is not initialized explicitly, then:
d5c737
    — if it has pointer type, it is initialized to a null pointer;
d5c737
    — if it has arithmetic type, it is initialized to (positive or
d5c737
      unsigned) zero;
d5c737
    — if it is an aggregate, every member is initialized (recursively)
d5c737
      according to these rules;
d5c737
    — if it is a union, the first named member is initialized
d5c737
      (recursively) according to these rules.
d5c737
...
d5c737
 21 If there are fewer initializers in a brace-enclosed list than there
d5c737
    are elements or members of an aggregate, or fewer characters in a
d5c737
    string literal used to initialize an array of known size than there
d5c737
    are elements in the array, the remainder of the aggregate shall be
d5c737
    initialized implicitly the same as objects that have static storage
d5c737
    duration.
d5c737
d5c737
This warning is thoroughly pointless.
d5c737
d5c737
Signed-off-by: Peter Jones <pjones@redhat.com>
d5c737
---
d5c737
 src/include/defaults.mk | 1 +
d5c737
 1 file changed, 1 insertion(+)
d5c737
d5c737
diff --git a/src/include/defaults.mk b/src/include/defaults.mk
d5c737
index df738feddea..af6a41a9824 100644
d5c737
--- a/src/include/defaults.mk
d5c737
+++ b/src/include/defaults.mk
d5c737
@@ -22,6 +22,7 @@ WARNINGS_GCC ?= -Wmaybe-uninitialized \
d5c737
 WARNINGS_CCC_ANALYZER ?= $(WARNINGS_GCC)
d5c737
 WARNINGS ?= -Wall -Wextra \
d5c737
 	    -Wno-address-of-packed-member \
d5c737
+	    -Wno-missing-field-initializers \
d5c737
 	    $(call family,WARNINGS)
d5c737
 ERRORS ?= -Werror -Wno-error=cpp $(call family,ERRORS)
d5c737
 CPPFLAGS ?=
d5c737
-- 
d5c737
2.26.2
d5c737